# 练习:用户输入姓名、年龄、工作、爱好 ,然后打印成以下格式
# ------------ info of Egon -----------
# Name : Egon
# Age : 22
# Sex : male
# Job : Teacher
# # ------------- end -----------------

PythonStudy——格式化输入小练习 随笔 第1张
 1 name = input("Please input your name :")
 2 age = input("Please input your age :")
 3 sex = input("Please input your sex :")
 4 job = input("Please input your job :")
 5 print("""------------ info of Egon -----------
 6 Name  : %s
 7 Age   : %s
 8 Sex   : %s
 9 Job   : %s
10 ------------- end -------------------""" %(name,age,sex,job))
View Code

 

扫码关注我们
微信号:SRE实战
拒绝背锅 运筹帷幄

SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。