I'm making a game and I'm getting the error: "IndexError: only integers, slices (:), ellipsis (...), numpy.newaxis (None) and integer or boolean arrays are valid indices."
In the following block of code, play_game is a function that returns a string, and roll_dice is a random array. Basically, I'm trying to get all the strings into an array, so into total_games. However, I can't do this because of this error, which I'm not sure exactly what it means. If someone could clarify what the error means or how I can fix this code it'd be greatly appreciated.
def game_session(num_games=50):
total_games = np.zeros(num_games)
for i in total_games:
total_games[i] = play_game(roll_dice())
return total_games