name | correct guesses | games together | ratio |
---|
name | correct guesses | games together | ratio |
---|
1 2 | def digital_root(number, base): return number - (base - 1) * ((number - 1) // (base - 1)) |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | def divis3(number): digits = str(number) number2 = 0 for digit in digits: number2 += int(digit) if len(str(number2)) > 1: return divis3(number2) if number2 in (3, 6, 9): return True return False number = 0 while number < 100: number += 1 string = "" if divis3(number): string += "Fizz" if str(number)[-1] in ("0", "5"): string += "Buzz" if string == "": string = str(number) print(string) |
post a comment