# 拼接字符串 |
s1 = 'Hello' |
s2 = 'World' |
s3 = s1 + ' ' + s2 # Hello World |
# 格式化字符串 |
name = 'Tom' |
age = 20 |
print (f 'My name is {name}, and I am {age} years old.' ) # My name is Tom, and I am 20 years old. |
# 字符串切割 |
s = 'Hello,World' |
print (s.split( ',' )) # ['Hello', 'World'] |