本文共 292 字,大约阅读时间需要 1 分钟。
这篇完全手打加深对于格式化输出的理解
name = input("name:")
age = int(input("age:"))occupation = input("occupation:")salary = int(input("salary:"))msg = ''' %s Profile
name: %sage: %doccupation: %ssalary: %d''' % (name, name, age, occupation, salary)print(msg)
转载于:https://blog.51cto.com/9272543/2119156