Skip to content

Instantly share code, notes, and snippets.

@akhilanandbv003
Created June 24, 2019 19:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save akhilanandbv003/fd4f3898bb7b9c36f7b9a8c198e01548 to your computer and use it in GitHub Desktop.
Save akhilanandbv003/fd4f3898bb7b9c36f7b9a8c198e01548 to your computer and use it in GitHub Desktop.
fizzbuzz.py
def get_fizz_buzz(number):
for num in range(number+1):
string = ""
if num % 3 == 0:
string = string + "Fizz"
if num % 5 == 0:
string = string + "Buzz"
if num % 5 != 0 and num % 3 != 0:
string = string + str(num)
print(string)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment