
Python booleans & if/elif/else

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

10 questions
Show all answers
1.
FLASHCARD QUESTION
Front
The result of this program:
Friday = False
if Friday:
...print "Jeans day!"
else:
...print "Dress code"
Options: Jeans day, Dress code, Nothing prints, Error
Back
Dress code
2.
FLASHCARD QUESTION
Front
What is the result of the code:
team = "Cowboys"
if team = "Cowboys":
...print "Dallas is #1"
Back
Error
3.
FLASHCARD QUESTION
Front
What is the output of the following code:
income = 4001
if income > 3000:
...print("Income is greater than 3000")
elif income > 4000:
...print("Income is greater than 4000")
Back
Income is greater than 3000
4.
FLASHCARD QUESTION
Front
Suppose you write the code to display "Cannot get a driver's license" if age is less than 16 and "Can get a driver's license" if age is greater than or equal to 16. Which of the following code is the best? Options: if age < 16: ...print("Cannot get a driver's license") if age >= 16: ...print("Can get a driver's license"), if age < 16: ...print("Cannot get a driver's license") else: ...print("Can get a driver's license"), if age < 16: ...print("Cannot get a driver's license") elif age >= 16: ...print("Can get a driver's license"), if age < 16: ...print("Cannot get a driver's license") elif age > 16: ...print("Can get a driver's license") elif age == 16: ...print("Can get a driver's license")
Back
if age < 16:
...print("Cannot get a driver's license")
else:
...print("Can get a driver's license")
5.
FLASHCARD QUESTION
Front
Assume x = 4 and y = 5. Which of the following is true?
Options: x < 5 and y < 5, x < 5 or y < 5, x > 5 and y > 5, x > 5 or y > 5
Back
x < 5 or y < 5
6.
FLASHCARD QUESTION
Front
What is the output of the following code?
ch = "F"
if ch == "f" and ch == "F"
...print(ch)
Back
nothing
7.
FLASHCARD QUESTION
Front
What is the output of the following code?
ch = "F"
if ch == "f" or ch == "F":
...print(ch)
Back
F
Create a free account and access millions of resources
Similar Resources on Wayground
10 questions
VA Licensing Review

Flashcard
•
10th Grade
10 questions
Python Boolean and If

Flashcard
•
9th - 12th Grade
7 questions
Java Basics #2

Flashcard
•
10th - 12th Grade
7 questions
Parts of Speech Test Review

Flashcard
•
9th - 12th Grade
12 questions
05 Financial Process & The Guest Cycle Y1

Flashcard
•
11th Grade
8 questions
HTML: Lesson 6 Copyright

Flashcard
•
11th Grade
14 questions
PYTHON -- Lists v2

Flashcard
•
9th - 12th Grade
10 questions
If/Else

Flashcard
•
9th - 12th Grade
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
10 questions
Proper Keyboarding Techniques

Interactive video
•
6th - 10th Grade
14 questions
Inputs and Outputs: Computer Science Intro

Lesson
•
5th - 9th Grade
10 questions
Understanding Computers: Hardware, Software, and Operating Systems

Interactive video
•
7th - 12th Grade
29 questions
AP CSP Unit 2 Review (Code.org)

Quiz
•
10th - 12th Grade