Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
No %, no division. solution in Creative category for Just Fizz! by epictoasty
def checkio(num: int) -> str:
# your code here
numstr = str(num)
numstr2 = numstr
numtest = 0
while numtest == 0 and len(str(numstr)) > 1:
for i in numstr :
numtest += int(i)
numstr = str(numtest)
numtest = 0
if numstr == "3" or numstr == "6" or numstr == "9" :
return "Fizz"
else :
return numstr2
return ""
print("Example:")
print(checkio(3))
# These "asserts" are used for self-checking
assert checkio(15) == "Fizz"
assert checkio(6) == "Fizz"
assert checkio(10) == "10"
assert checkio(7) == "7"
print("The mission is done! Click 'Check Solution' to earn rewards!")
May 19, 2023
Comments: