Skip to content

Commit

Permalink
fizzbuzz.py: refactoring with a clever use of or
Browse files Browse the repository at this point in the history
  • Loading branch information
James Prior and Joey committed Dec 12, 2017
1 parent 1897f5c commit 389df2a
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions fizzbuzz.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,4 @@ def fizzbuzz(n):
output += 'fizz'
if n % 5 == 0:
output += 'buzz'
if not output:
return str(n)
return output
return output or str(n)

0 comments on commit 389df2a

Please sign in to comment.