Last active
July 30, 2023 20:20
-
-
Save AstragoDE/8f495bc36ace45314773baac7cf38553 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for i in range(1, 101): | |
# `and`-Bedingung hinzugefügt, damit "Fizz" **Ausschließlich** bei `i % 3 == 0` ausgegeben wird. | |
if i % 3 == 0 and i % 5 > 0: | |
print("Fizz") | |
# `and`-Bedingung hinzugefügt, damit "Buzz" **Ausschließlich** bei `i % 5 == 0` ausgegeben wird. | |
if i % 5 == 0 and i % 3 > 0: | |
print("Buzz") | |
if i % 5 == 0 and i % 3 == 0: | |
print("FizzBuzz") | |
# `<=` durch `>=` ersetzt, damit die Zahlen, die nicht durch 3 oder 5 teilbar sind, ausgegeben werden. | |
if i % 3 >= 1 and i % 5 >= 1: | |
print(i) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment