import numpy as np n = 10000 sample_space = np.array ([ 1, 2, 3, 4, 5, 6]) to_like = 0 for k in range (0, n): terning1 = np.random.choice(sample_space) terning2 = np.random.choice(sample_space) if (terning1 - terning2 == 0): to_like = to_like + 1 print('To like oppnaaes med hyppighet:', f'{to_like/n :.4f}')