This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def fizzbuzz(stop): | |
| count_3 = count_5 = 0 | |
| for i in range(1, stop + 1): | |
| count_3 += 1 | |
| count_5 += 1 | |
| if count_3 == 3 and count_5 == 5: | |
| print('fizzbuzz') | |
| count_3 = count_5 = 0 | |
| elif count_3 == 3: | |
| print('fizz') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def fizzbuzz(start=1, stop=100): | |
| count_3 = count_5 = 0 | |
| for i in range(1, stop + 1): | |
| count_3 += 1 | |
| count_5 += 1 | |
| if count_3 == 3 and count_5 == 5: | |
| out = 'fizzbuzz' | |
| count_3 = count_5 = 0 | |
| elif count_3 == 3: | |
| out = 'fizz' |