Skip to content

Instantly share code, notes, and snippets.

@gaspart
Last active November 18, 2019 12:48
Show Gist options
  • Save gaspart/39b3f5cd17dd0fd9de60e17fada2b794 to your computer and use it in GitHub Desktop.
Save gaspart/39b3f5cd17dd0fd9de60e17fada2b794 to your computer and use it in GitHub Desktop.
for i in range(1,100):
if i % 3 == 0 and i % 5 == 0:
print("FizzBuzz")
elif i % 3 == 0:
print("Fizz")
elif i % 5 == 0:
print("Buzz")
else:
print(i)
print("\n".join(["Fizz" * (i % 3 == 0) + "Buzz" *(i % 5 == 0) or str(i) for i in range(1, 100)]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment