Skip to content

Instantly share code, notes, and snippets.

@xaldoxxx
Created February 16, 2022 13:40
Show Gist options
  • Save xaldoxxx/1ad293abf148a822eed1c975597c10d2 to your computer and use it in GitHub Desktop.
Save xaldoxxx/1ad293abf148a822eed1c975597c10d2 to your computer and use it in GitHub Desktop.
ejeciccio codewars
def FizzBuzz(num):
'''
FizzBuzz
<num> is an integer
Prints out FizzBuzz if <num> is divisible by 3 and 5
'''
if num % 3 == 0 and num % 5 == 0:
return "FizzBuzz"
elif num % 3 == 0:
return "Fizz"
elif num % 5 == 0:
return "Buzz"
else:
return num
if __name__ == "__main__":
for i in range(1,101):
print(FizzBuzz(i))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment