import random
import sys
Hdie = "A human has fallen."
Zdie = "A zombie has fallen!"
No = "Nothing happened."
Randeve = (Hdie, Zdie, No)
NumH = int(raw_input("How many humans are on your team?"))
NumZ = int(raw_input("How many zombies are in the area?"))
if NumH >= 101:
print "Maximum humans is 100."
sys.exit()
if NumZ >= 121:
print "Maximum zombies is 120."
sys.exit()
print(random.choice(Randeve))
if Randeve == Hdie:
print "hi"
每当我运行它并且它打印Hdie
,它就不会打印hi
。帮助我!你知道吗
将
random.choice(Randeve)
的结果赋给一个变量,并在适用的地方使用它。你知道吗相关问题 更多 >
编程相关推荐