# 昵 称:追光者♂
# 时 间: 2022/6/3/0003 7:30
# 字符串的大小写转换方法
s = 'hello,python'
a = s.upper() # 转成大写之后,会产生一个新的字符串对象
print('转换后:' + a, '标识:', id(a))
print('原来的:' + s, '标识:', id(s))
print('------------')
b = s.lower() # 转换之后,会产生新的字符串对象
print(b, id(b))
print(b == s) # b和s内容相同
print(b is s)
print('--------------')
s2 = 'hello,Python'
print(s2.swapcase()) # 大写变小写,小写变大写
print(s2.title()) # 每个英文单词的开头变成大写,其余变成小写



