Die Aufgabe wird geladen…
FizzBuzz is a classic way to practice conditions, especially the order of checks. The function fizzbuzz receives a number n and returns FizzBuzz if it is divisible by 15, Fizz if it is divisible by 3, and Buzz if it is divisible by 5. If none of these rules match, return the number itself as a string.
15"FizzBuzz"3"Fizz"5"Buzz"def fizzbuzz(n: int) -> str:
Melde dich an, um den Einreichungsverlauf zu sehen
AnmeldenMelde dich an, um den KI-Mentor zu nutzen
Anmelden15"FizzBuzz"3"Fizz"5"Buzz"7"7"30"FizzBuzz"-100"Buzz"