#创建字符串
Str1 = ‘Hello World‘
Str2 = "Let‘s go"
#重复输入字符串
print(‘hello‘ * 2)
#字符串的切片
print(‘helloworld‘[2:])
#格式化字符串
print(‘%s is a good teacher‘%‘wade‘)
#字符串的拼接
方法一:
a = ‘111‘
b = ‘222‘
c = ‘333‘
d = a + b + c
print(c) #111222333
方法二:
a = ‘111‘
b = ‘222‘
c = ‘333‘
c = ‘xxx‘.join([a,b,c]) #111xxx222xxx333 此方法较第一种方法效率高