You can use this assignment in your class!
Mastery Progress(100.0%)
i

Control Flow in Python Assignment

x = int(input())
if x % 3 == 0:
    print("Fizz")
elif x % 5 == 0:
    print("Buzz")
elif x % 3 == 0 and x % 5 == 0:
    print("FizzBuzz")Figure A
You answeredJUST NOW

Did you like this question?

(Voting helps us personalize your learning experience!)
imgInstructor solution
Alec KretchAUG 26, 2022, 4:19:43 PM
  • x = int(input())
if x % 3 == 0 and x % 5 == 0:
    print("FizzBuzz")
elif x % 3 == 0:
    print("Fizz")
elif x % 5 == 0:
    print("Buzz")Figure B

Was this helpful?

(Voting helps us personalize your learning experience!)
imgControl Flow in Python Presentation (page 6)

Was this helpful?

(Voting helps us personalize your learning experience!)
Think you've got it?
  • def a_vs_b(a,b):
    if a is b:
        print("spam")
    elif a == b:
        print("ham")
    else:
        print("eggs")Figure C
Select one of the following options:
  • A.
  • B.
Submit answer

Was this helpful?

(Voting helps us personalize your learning experience!)

You may exit out of this review and return later without penalty.