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

Flashcard
•
Computers
•
9th - 12th Grade
•
Hard
Quizizz Content
FREE Resource
Student preview

25 questions
Show all answers
1.
FLASHCARD QUESTION
Front
Back
To tell what will happen when an if-statement is false.
2.
FLASHCARD QUESTION
Front
Write the code to test if num1 and num2 are the same.
Back
if (num1 == num2)
3.
FLASHCARD QUESTION
Front
Consider the following code:
word = "kangaroo"
if (word == "KANGAROO"):
print ("TRUE")
else:
print ("FALSE")
What is output?
Back
FALSE
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.
FLASHCARD QUESTION
Front
Consider the following code: if (90 < = x <= 100). It should be rewritten as:
Back
if (90 < = x and x <= 100):
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.
FLASHCARD QUESTION
Front
When do you use an else statement?
Back
When you need something to happen when the if condition is false
Answer explanation
An else statement will run lines of code when all of the other conditions that are checked are false
6.
FLASHCARD QUESTION
Front
Write the code to test if num1 and num2 are NOT the same.
Back
if (num1 != num2 )
7.
FLASHCARD QUESTION
Front
What does != mean?
Back
not equal
Create a free account and access millions of resources
Similar Resources on Quizizz
20 questions
Int Prog: Lists and Functions

Flashcard
•
9th - 12th Grade
20 questions
Python Conditionals

Flashcard
•
9th - 11th Grade
20 questions
Computer Science Vocab 1

Flashcard
•
9th - 12th Grade
20 questions
Lists & Tuples

Flashcard
•
9th - 12th Grade
20 questions
Computer Science Vocab 1

Flashcard
•
9th - 12th Grade
15 questions
Python Functions and Exceptions Review

Flashcard
•
9th - 12th Grade
21 questions
AP CSP Unit 7: Parameters, Returns, and Libraries

Flashcard
•
9th - 12th Grade
15 questions
AP CSP Unit 7: Parameters, Returns, and Libraries

Flashcard
•
9th - 12th 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