You are actually getting a new random number every loop. Your problem is here:
...
if DeathDoor == door:
...
You are comparing an integer to a string, which always yields False
. The correct way is
if DeathDoor == int(door)
Also resetting RandomNum
and DeathDoor
to zero is unecessary.
Since you are just beginning to learn Python, you should consider reading https://www.python.org/dev/peps/pep-0008/, the Python style guide. If you follow the rules in the guide from the start, your code will be much easier to understand (not only for others but also for you).
1
solved Unable to renew random number on python