1 Star 0 Fork 0

野哥(沐野)/first_python_learn

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
day_04.py 2.20 KB
一键复制 编辑 原始数据 按行查看 历史
Admin 提交于 2023-07-29 04:47 . 字符串所有方法
#流程控制
# if...else ,if...elseif...else,while以及for
#age = int(input("请输入年龄:"))
# if age>= 18:
# print('成年')
# else:
# if age >= 12:
# print('少年')
# else:
# print('儿童')
#if elif else
# age = int(input("请输入年龄:"))
# if age >= 18:
# print('成年')
# elif age >= 12:
# print('少年')
# else:
# print('儿童')
# score = int(input('请输入你的成绩:'))
# if score >= 90 and <= 100:
# print('优秀')
# elif score >= 80 and score < 90:
# print('良好')
# elif score >= 70 and score < 80:
# print('中等')
# elif score >= 60 and score < 70:
# print('及格')
# else:
# print('不及格')
# if 0<= score <= 100:
# if score >= 90:
# print('优秀')
# elif score >= 80 and score < 90:
# print('良好')
# elif score >= 70 and score < 80:
# print('中等')
# elif score >= 60 and score < 70:
# print('及格')
# else:
# print('不及格')
# else:
# print('输入成绩不合法')
#pass
# if 0<= score <= 100:
# if score >= 90:
# print('优秀')
# elif score >= 80 and score < 90:
# print('良好')
# elif score >= 70 and score < 80:
# print('中等')
# elif score >= 60 and score < 70:
# pass
# else:
# print('不及格')
# else:
# print('输入成绩不合法')
# a = 50
# b = 10
# if a >= b:
# print(a)
# else:
# print(b)
# s = input('请输入:')
# print('ok' if s == 'yes' else s)
# print('hello world'*10)
# a = 1
# while a < 101:
# a += 1
# print('a =',a)
#for循环
# for i in range(1,101):
# print(i)
#
# for a in range(50):
# print(a)
# for b in range(0,101,2):
# print(b)
# sum = 0
# for i in range(1,101):
# sum = sum + 1
# print(sum)
# for i in range(2):
# print('===外层===')
# for j in range(5):
# print('====内层====')
# break:
#
# continue:
#作业
# year = int(input("请输入任意一个年份:"))
# if year % 4 == 0 and year % 100 != 0 or year % 400 == 0:
# print(year,'是闰年')
# else:
# print('平年')
# for i in range(1,10):
# for j in range(1,i+1):
# print(i,'*',j , '=',i*j,end = '\t')
# print()
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/ye-ge-mu-ye/first_python_learn.git
git@gitee.com:ye-ge-mu-ye/first_python_learn.git
ye-ge-mu-ye
first_python_learn
first_python_learn
master

搜索帮助