- 将字符串全部变为大写或小写。
name = "Ada Lovelace"
#全部大写
print(name.upper())
#全部小写
print(name.lower())
- 合并,拼接字符串
first_name = "Ada"
second_name = "Lovelace"
full_name = first_name + second_name
print(full_name)
name = "Ada Lovelace"
#全部大写
print(name.upper())
#全部小写
print(name.lower())
first_name = "Ada"
second_name = "Lovelace"
full_name = first_name + second_name
print(full_name)