Conditionals in Python by Ctrl-Zombies
Conditionals homework in Python
Conditionals Python Homework
Python Popcorn Hack
number1 = 10
number2 = 0
if ________ != 0: # fill in the condition
result = number1 ___ number2 # fill in the operator
print("The answer is", _______) # fill in what to print
else:
print("Error: Cannot ______ by zero!") # fill in the missing word
Error: Cannot divide by zero!
Part A: Answer the Question!
What does an if statement do in programming?
Write answer here
Part B: Python Practice
Write a Python program that checks if a number score = 85
is a passing grade (≥ 60). Print “Pass” if true, otherwise "Fail"
.
# <-- Example Code
x = 19
if x >= 18:
print("You can vote")
else:
print("You are too young to vote")
# <-- Do the homework in this code cell