Guest User

Untitled

a guest
Jun 25th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. def fb(n):
  2. r = ''
  3. if n % 3 == 0:
  4. r += "fizz"
  5. if n % 5 == 0:
  6. r += "buzz"
  7. if n % 3 != 0 and n % 5 != 0:
  8. r = str(n)
  9. return r
  10.  
  11. i = 1
  12. while i <= 20:
  13. print(i, fb(i))
  14. i = i + 1
Add Comment
Please, Sign In to add comment