2019年10月24日打印个人信息清单
#_author:Star
#date:2019/10/24
#打印个人信息清单
name=input("Name:")
age=int(input("Age:"))
job=input("Job:")
salary=input("Salary:")
if salary.isdigit():
salary=int(salary)
else:
exit("please input digit")
msg='''
--------info of %s---------------
Name:%s
Age:%d
Job:%s
Salary:%s
you will be retired in %d years
---------------------------------
''' %(name,name,age,job,salary,65-age)
print(msg)
Output:
Name:Mr.star
Age:22
Job:Python engener
Salary:12000
--------info of Mr.star---------------
Name:Mr.star
Age:22
Job:Python engener
Salary:12000
you will be retired in 43 years
---------------------------------