Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Fizz Buzz by Alex_sashaemelyanov09
# Taken from mission Just Fizz!
def checkio(num: int) -> str:
if not num % 3:
if not num % 5:
return "Fizz Buzz"
if not num % 3:
return "Fizz"
if not num % 5:
return "Buzz"
return str(num)
print("Example:")
print(checkio(15))
# These "asserts" are used for self-checking
assert checkio(15) == "Fizz Buzz"
assert checkio(6) == "Fizz"
assert checkio(10) == "Buzz"
assert checkio(7) == "7"
print("The mission is done! Click 'Check Solution' to earn rewards!")
Oct. 1, 2023
Comments: