QUESTION IMAGE
Question
19 multiple choice 2 points
when would you use a conditional in your code?
when you want to stop the program from running
when you want to store a value in a variable
when you want to make a decision based on certain conditions, like checking if a key was pressed
when you want the program to repeat an action
20 multiple choice 2 points
what is debugging?
finding and fixing errors in your code
writing new code from scratch
running a program for the first time
storing data in variables
21 multiple choice 2 points
what will the following code output if the variable age is 16?
age = 16
if age >= 18: print(\you can vote.\)
else: print(\you cannot vote yet.\)
\you cannot vote yet.\
no output
an error message
\you can vote.\
Step1: Analyze question 19
Conditional statements are used to make decisions based on certain conditions.
Step2: Analyze question 20
Debugging is the process of finding and fixing errors in code.
Step3: Analyze question 21
Given age = 16, since 16 < 18, the else block will execute.
Snap & solve any problem in the app
Get step-by-step solutions on Sovi AI
Photo-based solutions with guided steps
Explore more problems and detailed explanations
- When you want to make a decision based on certain conditions, like checking if a key was pressed
- Finding and fixing errors in your code
- "You cannot vote yet."