1.字符串的定义
a = “hello”
b = ‘westos’
c = “what’s up”
d = ‘what’s up’
e = “”"
用户管理系统
1.添加用户
2.删除用户
3.显示用户
“”"
print(a)
print(b)
print©
print(d)
print(e)
print(type(e))
2.字符串的特性
#索引: 0,1,2,3,4 索引值默认从0开始
s = ‘hello’
print(s[1])
print(s[0])
#切片
print(s[0:3]) #切片的规则: s[start?step] 从start开始,到end-1结束,步长:step
print(s[0:4:2])
#显示所有字符
print(s[:])
#显示前3个字符
print(s[:3])
#字符串逆序输出
print(s[::-1])
#除了第一个字符以外,其他全部输出
print(s[1:])
#重复
print( s * 10)
#连接
print(‘hello’ + ’ ’ + ‘world’)
print(‘hello’ +