码迷,mamicode.com
首页 > 编程语言 > 详细

python String Study log

时间:2015-02-12 10:53:09      阅读:167      评论:0      收藏:0      [点我收藏+]

标签:python   string   

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

标签:python   string   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!