Q:

Generating list of a random word, random number of times

How do I generate a list that will contain only the type of monster randomly chosen in choice a random number of times (1-5)?
monsters = ("trolls", "ogres", "werewolves", "dragons")
choice = random.choice(monsters)

I have tried the following which delivers the number but how do I make a list out of it?
num = random.randint(1, 5)
print("Your hero must fight against: ", num, choice)

A:

I am not sure whether I understand your questions, but I will answer it based on my understanding, please notify me if any mistakes.
Let's say you have a tuple of strings
monsters = ("trolls", "ogres", "werewolves", "dragons")

and you want to randomly pick random number of monsters from it, you can firstly generate a random number from the range by random.randint, and then use list generator to construct the list
nums = random.randint(1, 5) # nums = 2
monster_list = [random.choice(monsters) for i in range(nums)] 
# monster_list = ['ogres', 'trolls']

