import random rolls = [random.randint(1,6) for i in range(6)] print(rolls) [rolls.count(i) for i in range(1,7)] def test(n): rolls = [random.randint(1,n) for i in range(n)] print([rolls.count(i) for i in range(1,n + 1)]) test(6) test(100) def test(n): rolls = [random.randint(1,n) for i in range(n)] return sum([1 for count in [rolls.count(i) for i in range(1,n + 1)] if count > 0])/n test(6) test(100) test(10000) 1 - ((10000 - 1)/10000) ** 10000 import math print(1 - 1/math.e)