《零基础入门学习Python》最新版_学习记录
第002讲 作业 成绩100分mark = int(input("please input your final score:"))
if mark == 100:
print("good job")
elif mark > 100:
pass
elif mark < 0:
pass
else:
print("try harder next time.")
while True:
mark = int(input("please input your final score:"))
if mark == 100:
print("good job")
break
elif mark > 100 or mark < 0:
print("input again.")
continue
else:
print("try harder next time.")
break
while True:
mark = input("your mark")
print(mark.isnumeric())
if mark.isnumeric():
mark = int(mark)
if mark == 100:
print("good job")
break
elif mark > 100 or mark < 0:
print("input again.")
continue
else:
print("try harder next time.")
break
def marker():
mark = input("your mark")
if mark.isnumeric():
mark = int(mark)
if mark == 100:
print("good job")
elif mark > 100 or mark < 0:
print("input again.")
marker()
else:
print("try harder next time.")
marker()
{:5_108:} 第004讲 作业 99乘法表 版本一
for a in range (1,10):
# print(a)
result = ""
for b in range(1,a+1):
num = a * b
result += num.__str__()+" "
print(result)
第006讲 作业
# 分数 < 60,D
# 60 <= 分数 < 80,C
# 80 <= 分数 < 90,B
# 90 <= 分数 < 100,A
# 分数 == 100,S
#
grade = input("please input your exam score:")
while grade != "e":
grade = int(grade)
if grade == 100:
print("S")
elif 100 > grade >= 90:
print("A")
elif 80 <= grade < 90:
print("B")
elif 60 <= grade < 80:
print("C")
else:
print("D")
grade = input("please input your exam score:")
页:
[1]