【发布时间】:2018-08-27 18:49:40
【问题描述】:
这是我的代码:
rightPath = random.choice(North,East,South,West)
if selectPath == rightPath:
print("You slay the monsterous beast and proceed further into the castle")
print("This is just the start of your dangerous adventure")
else:
print("The Monster attacks leaving you helpless on the floor")
time.sleep(4)
print("You Died")
我想让它从北、东、南、西列表中随机选择一个方向。
【问题讨论】:
-
您确定
North,East,South,West是一个列表吗?random.choice需要一个列表作为参数。
标签: python python-3.x python-2.7