标签:end pre python 程序 字符 sdi exit inpu job
# 字符串格式化
name = input("name:")
age = int(input("age:"))
job = input("job:")
salary = input("salary:")
if salary.isdigit(): # 判断是否是数字
salary = int(salary)
# else:
# # print("please input digit")
# # exit()
# exit("please input digit") # 退出程序
msg = ‘‘‘
------info of %s------
name:%s
age:%s #%d
job:%s
salary:%s #%d
You will be retired in %s year
-------end-------
‘‘‘ % (name, name, age, job, salary, 65-age)
print(msg)
标签:end pre python 程序 字符 sdi exit inpu job
原文地址:http://www.cnblogs.com/1510152012huang/p/7898532.html