
Python booleans & if/elif/else
Flashcard
•
Computers
•
9th - 12th Grade
•
Practice Problem
•
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
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
15 questions
Rabbit Anatomy Flashcard
Flashcard
•
9th - 12th Grade
10 questions
Functions, Domain, and Range
Flashcard
•
9th - 12th Grade
10 questions
Learn About Asthma
Flashcard
•
KG - University
7 questions
Python - Flow control
Flashcard
•
11th Grade
12 questions
K1 Chinese Pinyin
Flashcard
•
KG
15 questions
Journalism Midterm
Flashcard
•
9th - 12th Grade
15 questions
ESRT Pg 8 & 9
Flashcard
•
9th - 12th Grade
15 questions
FLASHCARD: Ch. 4.8 - 4.9 (Math for Finance)
Flashcard
•
9th - 12th Grade
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade