字符串
表示 ‘ ’ “ ”
name='Jeff'
print(name)
访问
print(name[2])
修改
name[1]='x'
print(name)
name='kobe'
print(name)
常用操作
price='¥9.9'
字符串替换
price=price.replace("¥","")
价格上涨十倍
pricenew=float(price)*10
print(pricenew)
写一个价值一亿的AI代码
while True:
set=input('')
set= set.replace("么?","!")
print(set)
strip去空格操作
name=' nenudu '
print(len(name))
name=name.strip()
print(len(name))
join把列表编程字符串
li=['你','好','帅']
disk_pash=['C:','Users','12442','Desktop','MVC实训']
path='\\'.join(disk_pash)
print(path)
li=''.join(li)
print(li)