xah icon

Training Problem Y - Fizz Buzz

xah | PRO | 09/30/20 10:28:43 PM UTC (Edited) | 0 ⭐ | 399 👁️ | Never ⏰ | []
Python |

390 B

|

None

|

0 👍

/

0 👎

legend = []
sample = int(input())
 
while sample:
    if sample == 0:
        break
 
    elif sample % 3 == 0:
        note = 'Fizz'
        if sample % 5 == 0:
            note = 'Fizz Buzz'
        legend.append(note)
 
    elif sample % 5 == 0:
        legend.append('Buzz')
 
    else:
        legend.append(sample)
 
    sample = int(input())
 
for l in legend:
    print(l)

Comments