python 中字符串的格式化

# 字符串格式化
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)
上一篇:AIX扩展文件系统的大小


下一篇:ES - es为什么要移除type?