21 Jun 2023
no_of_coins = 100
# True = Head # False = Tails
coins = [True for i in range(no_of_coins)]
for i in range(1,len(coins)): for j in range(i,len(coins),i+1): coins[j] = not coins[j] print(coins.count(True))