Add fizzbuzz.py
This commit is contained in:
parent
1d66aa92ab
commit
b938617d9d
1 changed files with 12 additions and 0 deletions
12
fizzbuzz.py
Normal file
12
fizzbuzz.py
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
def fizzbuzz():
|
||||
for i in range(1, 101):
|
||||
if i % 3 == 0 and i % 5 == 0:
|
||||
print("FizzBuzz")
|
||||
elif i % 3 == 0:
|
||||
print("Fizz")
|
||||
elif i % 5 == 0:
|
||||
print("Buzz")
|
||||
else:
|
||||
print(i)
|
||||
|
||||
fizzbuzz()
|
||||
Loading…
Add table
Add a link
Reference in a new issue