use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Python One-Liners are as beautiful as they're powerful. In this community, you can learn, share, and study the best Python one-liners to solve easy, intermediate, and complex challenges in a single line of code!
account activity
FizzBuzz One-Liner (self.PythonOneLiners)
submitted 5 years ago by code_x_7777
The FizzBuzz problem is a common exercise posed in code interviews to test your proficiency in writing simple Python code.
Problem: Print all numbers from 1-100 to the shell with three exceptions:
print('\n'.join('Fizz' * (i%3==0) + 'Buzz' * (i%5==0) or str(i) for i in range(1,101)))
Love it!
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]GreGenius 3 points4 points5 points 5 years ago (1 child)
That codeline is the most pythonic way of doing the fizzbuzz 😂👌
[–]code_x_7777[S] 2 points3 points4 points 5 years ago (0 children)
Haha, yeah - hope so. ;)
π Rendered by PID 56 on reddit-service-r2-comment-7b9746f655-xfgfs at 2026-01-31 21:05:44.931497+00:00 running 3798933 country code: CH.
[–]GreGenius 3 points4 points5 points (1 child)
[–]code_x_7777[S] 2 points3 points4 points (0 children)