标签:NPU 浮点数 job put 格式化 end ring lse ret
name = input("name:")
age = int(input("age:"))
job = input("job:")
salary = input("salary:")
if salary.isdigit(): #长的像不像数字,比如200d。“200”
salary = int(salary)
# else:
# #print("must input digit")
# exit("must input digit")# 退出程序
#
msg = ‘‘‘
------------info of %s-----------
Name: %s
Age : %d
Job : %s
Salary: %f
You will be retired in %s vears
------------ end ---------------
‘‘‘ % (name,name,age,job,salary,65-age)
print(msg)
# 字符串格式化输出
# 占位符 %s s = string
# %d d = digit 整数
# %f f= float 浮点数,约等于小数。
标签:NPU 浮点数 job put 格式化 end ring lse ret
原文地址:https://www.cnblogs.com/fy414371/p/9195077.html