首页 > 编程语言 > 详细

python String Study log

时间:2015-02-12 10:50:18      阅读:268      评论:0      收藏:0      [点我收藏+]

1. "" , ‘‘, """   """

2. Strings are stored as sequences of characters indexed by integers, starting at zero.

3. To extract a substring, use the slicing operator s[i:j].

4. Strings are concatenated with the plus (+) operator:
     g = a + " This is a test"

5. To perform mathematical calculations, strings first have to be converted into a numeric
    value using a function such as int() or float(). For example:
    z = int(x) + int(y) # z = 79 (Integer +)

6. Non-string values can be converted into a string representation by using the str(),
     repr(), or format() function.


python String Study log

原文:http://blog.csdn.net/jiandanjinxin/article/details/43758739

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!