I am trying to create 10 rooms that have a random number of boxes and apples. When I try to display them I get this error: "IndexError('list index out of range',)" Also, I am looking for the best method to handle multiple dictionaries and work on them. This is my code:
rooms=[]
for i in range(1,11):
a={'apples':random.randint(0,3),'box':random.randint(0,2)}
rooms.append(dict(a))
for i in range(1,11):
print(rooms[i])