1、String
1.1字符串拼接
Python使用’+’进行拼接字符串
first_name = 'oliver'
last_name = 'smith'
full_name = first_name...+ ' ' + last_name
print(full_name)
>>> oliver smith
1.2字符串截取
Python 截取字符串使用 变量[头下标:尾下标],就可以截取相应的字符串,...:] # 输出字符串,开始位置从右开始数位置为5,到结尾
>> cdefg
print myStr[:-2] # 输出字符串从0开始,终止位置从右开始数位置2
>> abcde
1.3字符串替换
Python...myStr = 'akakak'
myStr = myStr.replace('k','8',2) #将字符串里的k替换为8,前两个
print myStr
>> a8a8ak
1.4字符串查找
Python...")
print(member)
>> ['a', 'b', 'c', '1', '2', 3, 'python']
extend可以在列表后方添加一个列表:
member = ['a','b','c'