Vegetarianboy30

fizzbuzz in python lmao

Jan 20th, 2021
754
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.17 KB | None | 0 0
  1. for i in xrange(1,101):
  2.     fizz = 'fizz' if i % 3 == 0 else ''
  3.     buzz = 'buzz' if i % 5 == 0 else ''
  4.  
  5.     output = fizz + buzz if fizz or buzz else i
  6.  
  7.     print output
Add Comment
Please, Sign In to add comment