- Notifications
You must be signed in to change notification settings - Fork 43
Expand file tree
/
Copy pathfizzbuzz.py
More file actions
Latest commit
31 lines (24 loc) · 528 Bytes
/
Copy pathfizzbuzz.py
File metadata and controls
31 lines (24 loc) · 528 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/python3
importmath
importos
importrandom
importre
importsys
#
# Complete the 'fizzBuzz' function below.
#
# The function accepts INTEGER n as parameter.
#
deffizzBuzz(n):
fornumberinrange(1, n+1):
ifnumber%3==0andnumber%5==0:
print('FizzBuzz')
elifnumber%3==0:
print('Fizz')
elifnumber%5==0:
print('Buzz')
else:
print(number)
if__name__=='__main__':
n=int(input().strip())
fizzBuzz(n)