I am making a program where I need to generate random values into a list. The user is asked to enter how many random values (chests - represented by the letter 'T') they would like to generate onto a 2D grid. The problem is that when the user types '8' as the number of random 'chests' they would like to generate, sometimes only 5 or 6 chests are generated to the grid (probably because the random integers repeat onto the grid and don't index at unique points in the grid). The number of chests are never accurately represented to the grid. How can I ensure all random values are assigned to unique indexes on the 2D grid?
def chests():
global chest
chest = int(input("How many chests would you like in the game?"))
for i in range(0,chest):
board[randint(0, 4)][randint(0, 4)] = "T"
return board
numpyor do you need pure python implementation?