Skip to content

Instantly share code, notes, and snippets.

@RPDiep
Last active December 2, 2017 12:34
Show Gist options
  • Save RPDiep/451c795addce47117b4658165c013653 to your computer and use it in GitHub Desktop.
Save RPDiep/451c795addce47117b4658165c013653 to your computer and use it in GitHub Desktop.
FizzBuzz python oneliner
print('\n'.join([('Fizz' if i % 3 == 0 else '') + ('Buzz' if i % 5 == 0 else '') or str(i) for i in range(1,101)]))
@RPDiep
Copy link
Author

RPDiep commented Dec 2, 2017

Not to call this a thing of beauty, but it is possible to create a python oneliner for the fizzbuzz problem 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment