SHARE
TWEET

FizzBuzz

DeaD_EyE Nov 19th, 2018 227 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def fizz_buzz(x):
  2.     by3 = x % 3 == 0
  3.     by5 = x % 5 == 0
  4.     if by3 and by5:
  5.         return 'FizzBuzz'
  6.     elif by3:
  7.         return 'Fizz'
  8.     elif by5:
  9.         return 'Buzz'
  10.     else:
  11.         return x
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top