# Author:hjl
name = "hjl"
print("my name is" , name)
print("你")
name = input("name:")
age = input("age")
age_d = int(age)
print("age:",type(age),"age_d:",type(age_d))
info = ''' info
name:%s 用占位符%%和%%()
age: %d
'''%(name,age_d) # 用占位符%和%()
print(info)
info2 = ''' info2
name:{_a}
age: {_b}
'''.format(_a=name, _b=age) # 用大括号{}和format()
print(info2)
python变量,输入,打印
最新推荐文章于 2024-09-11 16:46:54 发布