字符串运算符
a
="Hello"
b
="Python"
print("a+b输出结果:",a
+b
)
print("a*2输出结果:",a
*2)
print("a[1]输出结果:",a
[1])
print("a[1:4]输出结果:",a
[1:4])
if('H' in a
):
print("H在变量a中")
else:
print("H不在变量a中")
if('M' not in a
):
print('M不在变量a中')
else:
print('M在变量a中')
print(r
'\n')
print(R
'\n')
Python 的字符串内建函数
转载请注明原文地址: https://yun.8miu.com/read-17468.html