python-day05-fullstack-#判断数字,推出,使用占位符,格式化输出

pycharm使用

  IDE:集成开发环境;integrated development environment

  VIM:#经典的linux下的文本编辑器

  Emacs #linux文本编辑器

  Eclipse #Java IDE,支持python,C,C++

  Visual studio  #mircrosoft开发

  pycharm,是只要用户python开发的IDE。

   location:位置

  interpreter:解释器

格式化输出:

#Time : 2020/5/26 20:39
#Author : wb
#FileName: 格式化输出.py
#Email : 945784220@qq.com
#Software: PyCharm
#Blog:https://www.cnblogs.com/BBS2013/
name = input("name:")
age = input("age:")
job = input("job:")
salary=input("salary:")
# if salary.isdigit():#判断是否是数字,比如200d
#     salary=int(salary)
# else:
#     #print('musit input digit')
#     exit("must input digit") #推出程序

#print(name,age,job,salary)
msg='''
-------info of %s----
name:      #占位符 %s =string
age:%d     # %d必须输入数字  
job:%s
salary:%d
you will be retired in %s years
'''% (name,name,age,job,salary,65-int(age))
print (msg)

#占位符
# %s s=string
# %d d=digit整数
# %f f=float浮点数,小数

#判断数字,推出,使用占位符
原文地址:https://www.cnblogs.com/BBS2013/p/12968408.html