When do you use an else statement?
Intro to CS Unit 3 Review

Quiz
•
Computers
•
9th - 12th Grade
•
Medium
Sammi McConnell
Used 15+ times
FREE Resource
25 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
To Input a variable
To handle string values
To tell what will happen when an if-statement is false.
To end an IF statement.
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Write the code to test if num1 and num2 are the same.
if (num1 = num2)
if (num1 < num2)
if (num1 == num2)
if (num1 != num2)
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
1. Consider the following code:
word = "kangaroo"
if (word == KANGAROO"):
print ("TRUE")
else:
print ("FALSE")
What is output?
KANGAROO
TRUE
FALSE
CAPTAIN
Answer explanation
Capitalized words in a string are not equal to their lower case counter parts. So,
“kangaroo” does not
equal “KANGAROO” which is why the output is false
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
3. Consider the following code:
if (90 < = x <= 100)
It should be rewritten as:
if (90 < = x <= 100):
if (90 < = x and <= 100):
if (90 < = x and x <= 100):
Nothing, the if statement is correct
Answer explanation
This correctly tests if 90 is less than or equal to x and tests if x is less than or equal to 100
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
When do you use an else statement?
When you need something to happen when the if condition is false
To make a follow-up True/False decision
To allow programs to make decisions.
To get user input
Answer explanation
An else statement will run lines of code when all of the other conditions that are checked are false
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Write the code to test if num1 and num2 are NOT the same.
if (num1 != num2 )
if (num1 == num2 )
if (num1 = num2)
if (num1 < num2 )
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does != mean?
equal
not equal
less than
both
Create a free account and access millions of resources
Similar Resources on Quizizz
20 questions
Python Programming Quiz

Quiz
•
9th Grade - University
25 questions
AQA GCSE Programming

Quiz
•
10th Grade
30 questions
EOT Revision Programming and Algorithms

Quiz
•
8th - 10th Grade
25 questions
Global 3r ESO

Quiz
•
12th Grade
22 questions
Basic Coding Concepts in GDScript

Quiz
•
11th Grade
25 questions
T-Level DPDD: Sequential Programming Concepts Quiz

Quiz
•
11th Grade
30 questions
AP CS A Unit 3 2020-2021

Quiz
•
9th - 12th Grade
30 questions
Programming Techniques

Quiz
•
8th - 10th Grade
Popular Resources on Quizizz
15 questions
Character Analysis

Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
10 questions
American Flag

Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension

Quiz
•
5th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25

Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers

Quiz
•
6th - 8th Grade
Discover more resources for Computers
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
20 questions
Taxes

Quiz
•
9th - 12th Grade
17 questions
Parts of Speech

Quiz
•
7th - 12th Grade
20 questions
Chapter 3 - Making a Good Impression

Quiz
•
9th - 12th Grade
20 questions
Inequalities Graphing

Quiz
•
9th - 12th Grade
10 questions
Identifying equations

Quiz
•
KG - University