N = 15 count = 0 for i in range(1, N + 1): current = i while current != 0: if current % 10 == 3 or current % 10 == 6 or current % 10 == 9: count += 1 current = current // 10 print(count)
To embed this project on your website, copy the following code and paste it into your website's HTML: