We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8f51146 commit 2874fddCopy full SHA for 2874fdd
2 files changed
Level_08/fizzbuzz.py Level_08/Beispielcode/fizzbuzz_func.pyLevel_08/fizzbuzz.py renamed to Level_08/Beispielcode/fizzbuzz_func.py
Level_08/Beispielcode/fizzbuzz_iter.py
@@ -0,0 +1,10 @@
1
+def fizz_buzz(number: int) -> str:
2
+ output = ""
3
+ if number % 3 == 0:
4
+ output += "fizz"
5
+ if number % 5 == 0:
6
+ output += "buzz"
7
+ return output or str(number)
8
+
9
+for val in map(fizz_buzz, range(1, 16)):
10
+ print(val)
0 commit comments