Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1

2

3

4

5

6

7

8

9

10

11

12

13

def fizzbuzz(n): 

2 ↛ 3line 2 didn't jump to line 3, because the condition on line 2 was never true if n % 15 == 0: 

return "FizzBuzz" 

if n % 3 == 0: 

return "Fizz" 

if n % 5 == 0: 

return "Buzz" 

return str(n) 

 

assert fizzbuzz(3) == "Fizz" 

assert fizzbuzz(4) == "4" 

assert fizzbuzz(5) == "Buzz"