Skip to content

Instantly share code, notes, and snippets.

@erayerdin
Created September 2, 2016 15:15
Show Gist options
  • Save erayerdin/92b89a370b7ea6adf8382fc22df86fe6 to your computer and use it in GitHub Desktop.
Save erayerdin/92b89a370b7ea6adf8382fc22df86fe6 to your computer and use it in GitHub Desktop.
Fizzbuzz Problem Solved By Eray Erdin in Python 3 By The Help of Functional Programming Paradigm
def fizzbuzz(n):
if n%3 == 0 and n%5 == 0:
return "FizzBuzz"
elif n%3 == 0:
return "Fizz"
elif n%5 == 0:
return "Buzz"
else:
return str(n)
fb = map(fizzbuzz, range(101))
print("\n".join(fb))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment