标签:字符 The name code python inpu class 个人 render
name = input("请输入你的名字:") print(name) #字符串改为小写 print("Hello " + name.lower()+",welcome to the world of Python!") #字符串改为大写 print("Hello " + name.upper()+",,welcome to the world of Python!") #单词首字母大写 print("Hello " + name.title()+",,welcome to the world of Python!")
输出结果:
请输入你的名字:ivAN Sun ivAN Sun Hello ivan sun,welcome to the world of Python! Hello IVAN SUN,,welcome to the world of Python! Hello Ivan Sun,,welcome to the world of Python!
Python小刀 -title()- lower()- upper()- 调整名字大小写
标签:字符 The name code python inpu class 个人 render
原文地址:https://www.cnblogs.com/a001ai-es/p/12827630.html