【发布时间】:2021-08-15 01:21:53
【问题描述】:
import random
participants = ['Jack','Jill','Larry','Tom']
def Guess(participants):
my_participant_dict = {}
for participant in participants:
my_participant_dict[participant] = random.randint(1, 9)
if my_participant_dict['Larry'] == 9:
return True
else:
return False
print(Guess(participants))
【问题讨论】:
-
1) 代码格式很重要。 2)你的实际问题是什么?我强烈建议您阅读help section of the site,以获取有关如何在 stackoverflow 上提问和回答问题的指导。
标签: python random try-catch except