
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
8 questions
Python Casting & Data Types

Flashcard
•
9th - 12th Grade
10 questions
History of Animation + Copyright

Flashcard
•
10th - 12th Grade
11 questions
Financial Literacy

Flashcard
•
9th - 12th Grade
7 questions
Digital Citizenship

Flashcard
•
KG
10 questions
If/Else

Flashcard
•
9th - 12th Grade
12 questions
CodeHS - Intro to Python - Conditionals Flashcard

Flashcard
•
9th Grade - Professio...
9 questions
Georgia Driving Test

Flashcard
•
9th - 12th Grade
8 questions
Social Studies Chapter 1: Citizenship

Flashcard
•
10th - 11th Grade
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
Appointment Passes Review

Quiz
•
6th - 8th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
20 questions
Grammar Review

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

Interactive video
•
6th - 10th Grade
17 questions
[AP CSP] Binary Number System

Lesson
•
9th - 12th Grade
15 questions
1.1 Network Fundamentals Quiz

Quiz
•
10th Grade
20 questions
Understanding Information Processing Cycle

Quiz
•
10th Grade
19 questions
AP CSP Unit 1 Review (code.org)

Quiz
•
10th - 12th Grade