I am trying to generate 5x5 list that has exactly 10 ones placed in a random locations in the 2D list.
I want to make the rest of the entries is zeroes. How can I make it?
import random def randomNumbers(): mylist=[random.randint(0, 1) for _ in range(5)] return mylist