python String Study log

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.


郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。