score = 75
if 100 >= score >= 90:
print("A")
if 90 > score >= 80:
print("B")
if 80 > score >= 70:
print("C")
if 70 > score >= 60:
print("D")
if 60 > score :
print("E")
if score < 0 or score > 100:
print("输入错误,请检查!")
C
score = 109
if 100 >= score >= 90:
print("A")
if 90 > score >= 80:
print("B")
if 80 > score >= 70:
print("C")
if 70 > score >= 60:
print("D")
if 60 > score :
print("E")
if score < 0 or score > 100:
print("输入错误,请检查!")
输入错误,请检查!
score1 = int(input("请输入您的分数:"))
if 100 >= score1 >= 90:
print("A")
else:
if 90 > score1 >= 80:
print("B")
else:
if 80 > score1 >= 70:
print("C")
else:
if 70 > score1 >= 60:
print("D")
else:
print("E")
请输入您的分数:68
D
score2 = int(input("请输入您的分数:"))
if 100 >= score2 >= 90:
print("A")
elif 90 > score2 >= 80:
print("B")
elif 80 > score2 >= 70:
print("C")
elif 70 > score2 >= 60:
print("D")
elif 60 > score2:
print("E")
else:
print("输入错误,请检查!")
请输入您的分数:56
E
t = 100
s = 0
while t > 0:
s = s + t
t = t - 1
print("s = ",s)
s = 5050
t1 = 1
s1 = 0
while t1 <= 100:
s1 = s1 + t1
t1 = t1 + 1
print("s1 = ",s1)
s1 = 5050
list1 = list()
list2 = list()
list3 = list()
for a in range(10):
list1.append(a)
print("list1 = ",list1)
list1 = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
for b in ["a","b","c","d","e"]:
list2.append(b)
print("list2 = ",list2)
list2 = ['a', 'b', 'c', 'd', 'e']
print(list(range(0,100,17)))
[0, 17, 34, 51, 68, 85]
s2 = 0
for c in range(101):
s2 = s2 + c
print("s2 = ",s2)
s2 = 5050
for year in range(2018,2100):
if (year % 4 == 0) and (year % 100 != 0) or (year % 400 == 0):
break
print("2018年后出现的第一个闰年是:",year)
2018年后出现的第一个闰年是: 2020
for year1 in range(2018,2050):
if (year1 % 4 == 0) and (year1 % 100 != 0) or (year1 % 400 == 0):
print(year1)
continue
2020
2024
2028
2032
2036
2040
2044
2048
|