如何使我的游戏工作?

2024-04-19 22:09:46 发布

您现在位置:Python中文网/ 问答频道 /正文

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。帮助我!你知道吗


Tags: noimportinputrawifsysrandomint