fork download
  1. print('我的第一个python程序')
  2. print(25)
  3. #输入你的名字
  4. name=input('请输入你的名字:')
  5. #输出名字 问好
  6. print(name+'欢迎你,使用python')
  7. #输入年龄
  8. age =int(input('请输入你的年龄:'))
  9. #输出年龄
  10. print(f'你的年龄是:{age}') #f 代表格式化输出,{}大括号调用变量、获取变量值
  11. #条件检查
  12. if age<18:
  13. print('未成年!')
  14. else:
  15. print('成年了!')
  16. #多条件检查
  17. if age<18:
  18. print('考好成绩')
  19. elif age>=18 and age<=25:
  20. print('找好工作')
  21. elif age>25 and age<60:
  22. print('赚钱养家')
  23. else:
  24. print('环游世界')
  25.  
  26.  
Success #stdin #stdout 0.07s 7992KB
stdin
江江
18
stdout
我的第一个python程序
25
请输入你的名字:江江欢迎你,使用python
请输入你的年龄:你的年龄是:18
成年了!
找好工作