Skip to content

Pyscho Parent Problem


Eager to make your mark on the PTA, you decide the best way to hide eggs for the upcoming Easter egg hunt is to use NumPy . You represent the field as a 10x10 array of 0s.

import numpy as np

field = np.zeros(shape = (10, 10))

print(field)
# [[0. 0. 0. 0. 0. 0. 0. 0. 0. 0.]
#  [0. 0. 0. 0. 0. 0. 0. 0. 0. 0.]
#  [0. 0. 0. 0. 0. 0. 0. 0. 0. 0.]
#  [0. 0. 0. 0. 0. 0. 0. 0. 0. 0.]
#  [0. 0. 0. 0. 0. 0. 0. 0. 0. 0.]
#  [0. 0. 0. 0. 0. 0. 0. 0. 0. 0.]
#  [0. 0. 0. 0. 0. 0. 0. 0. 0. 0.]
#  [0. 0. 0. 0. 0. 0. 0. 0. 0. 0.]
#  [0. 0. 0. 0. 0. 0. 0. 0. 0. 0.]
#  [0. 0. 0. 0. 0. 0. 0. 0. 0. 0.]]

Insert 20 random normal values at random (non repeating) locations in the grid. Then you'll know how much candy to hide at each spot.


Try with Google Colab