Compare commits
3 Commits
a2e4833c6f
...
5026f9cd45
Author | SHA1 | Date | |
---|---|---|---|
5026f9cd45 | |||
99731bbf4e | |||
0075ab0646 |
@ -1,19 +0,0 @@
|
||||
stop = int(1E4)
|
||||
triggers = [3, 5]
|
||||
printout = ['fizz', 'buzz']
|
||||
|
||||
def isNumberDivisibleBy(num:int, div:int, msg:str) -> str:
|
||||
if num % div == 0: return msg
|
||||
return ""
|
||||
|
||||
output = ""
|
||||
for index in range(1, 1+stop):
|
||||
tmp = ""
|
||||
for div, out in zip(triggers, printout):
|
||||
tmp += isNumberDivisibleBy(index, div, out)
|
||||
|
||||
if len(tmp) == 0: tmp = str(index)
|
||||
|
||||
output += tmp + "\n"
|
||||
|
||||
print(output)
|
Loading…
Reference in New Issue
Block a user