1. 程式人生 > >python基礎--字串

python基礎--字串

1.舉例說明:(引號)

n1 = "alex"

n2 = 'sb'

n3 = '''en'''

n4 = """shiya"""

2.字串的運算:

加法:

>>> n1 = "alex"
>>> n2 = "sb"
>>> n1+n2
'alexsb'

乘法:

>>> n1 = "mao"
>>> n1*10
'maomaomaomaomaomaomaomaomaomao'