I need create more than one instances of a class based on user input. But after getting the userInput, I do not know what to do with it.
class Monster():
def __init__(self):
self.hp = 25
def hit(self, hp):
self.hp -= h
The code that gets the userInput for to create them, and the code that assigns each monster to a door.
def nMonsters():
global nMonsters
nMonsters = int(raw_input("How many monsters are hiding?"))
if nMonsters >= nDoors:
while nMonsters >= nDoors:
clear()
print ("Every monster needs a room.")
print ("Rooms available"), nDoors - 1
nMonsters = int(raw_input("How many monsters are hiding?"))
def monsterDoor_assignement():
global monsterDoor
monsterDoor = random.randint(1, nDoors)