











scores = [75, 88, 92, 67, 95, 83, 79]
index = 0
for score in scores:
if score >85:
print(score)
print(index)
index = index + 1
scores = [75, 88, 92, 67, 95, 83, 79]
print("高分榜:")
for index, score in enumerate(scores):
if score >80:
print(f'第{index+1}个学生的成绩是{score}')
import random
def guessing_game():
number = random.randint(0,100)
while True:
user_input = input("请输入你的答案:")
if int(user_input)> number:
print("Too high")
elif int(user_input)< number:
print("Too low")
else:
print("Just Right")
break
guessing_game()
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。