first commit
This commit is contained in:
18
FizzBuzz/Python/fizzbuzz.py
Normal file
18
FizzBuzz/Python/fizzbuzz.py
Normal file
@@ -0,0 +1,18 @@
|
||||
import sys
|
||||
|
||||
try:
|
||||
N = int(input("How many fizzbuzzes?: "))
|
||||
except:
|
||||
print("Invalid input")
|
||||
sys.exit()
|
||||
|
||||
for x in range(1,N+1):
|
||||
if x % 3 == 0 or x % 5 == 0:
|
||||
if x % 3 == 0:
|
||||
print("fizz", end="")
|
||||
if x % 5 == 0:
|
||||
print("buzz", end="")
|
||||
else:
|
||||
print(x, end="")
|
||||
print("")
|
||||
|
||||
Reference in New Issue
Block a user