标签:输出 dig 数字 name -- 退出 inpu ret info
name = input(‘Name : ‘)
age = int(input(‘Age : ‘))
job = input(‘Job : ‘)
salary = input(‘Salary : ‘)
if salary.isdigit(): # 判断长得像数字
salary = int(salary)
else:
exit(‘must input digit‘) # 退出
msg = ‘‘‘
-----info of %s -------
Name: %s
Age : %d
Job : %s
Salary : %d
You will be retired in %s years
--------end------------
‘‘‘ % (name,name,age,job,salary,65-age)
print(msg)
标签:输出 dig 数字 name -- 退出 inpu ret info
原文地址:https://www.cnblogs.com/xiaobinglife/p/9261160.html