MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1vda9j/deleted_by_user/cerad73/?context=3
r/ProgrammerHumor • u/[deleted] • Jan 16 '14
[removed]
446 comments sorted by
View all comments
Show parent comment
3
There are a few python features that make it sillier. Try:
print('\n'.join((i % 3 == 0) * 'Fizz' + (i % 5 == 0) * 'Buzz' + (i % 3 != 0) * (i % 5 != 0) * str(i) for i in range(1, 101)))
2 u/hbwales Jan 17 '14 how about:print('\n'.join((i % 3 == 0) * 'Fizz' + (i % 5 == 0) * 'Buzz' or str(i) for i in range(1, 101))) 2 u/thirdegree Violet security clearance Jan 17 '14 Things like this make me with it was valid python to use ! as a not operator :(
2
how about:
print('\n'.join((i % 3 == 0) * 'Fizz' + (i % 5 == 0) * 'Buzz' or str(i) for i in range(1, 101)))
2 u/thirdegree Violet security clearance Jan 17 '14 Things like this make me with it was valid python to use ! as a not operator :(
Things like this make me with it was valid python to use ! as a not operator :(
View all comments
Show parent comment
3
u/VanFailin Jan 16 '14
There are a few python features that make it sillier. Try:
print('\n'.join((i % 3 == 0) * 'Fizz' + (i % 5 == 0) * 'Buzz' + (i % 3 != 0) * (i % 5 != 0) * str(i) for i in range(1, 101)))