
Understanding Python If-Else Statements
Quiz
•
Information Technology (IT)
•
11th Grade
•
Practice Problem
•
Medium
Ерасыл Тлеудин
Used 1+ times
FREE Resource
Enhance your content in a minute
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code: print(True and False)?
True or False
False
True
None
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you write an if statement in Python?
if: condition then do_something
if condition do_something
if condition: do_something elif another_condition: do_something_else else: do_fallback
if (condition) { do_something }
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of print(not True)?
None
1
False
True
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Explain the difference between 'and' and 'or' in Python.
'and' returns True if both conditions are False, while 'or' returns False if both are True.
The difference is that 'and' requires both conditions to be True, while 'or' requires at least one condition to be True.
'and' can be used with more than two conditions, while 'or' cannot.
'and' checks for equality, while 'or' checks for inequality.
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the result of True or False and False?
True
False or True
True and False
False
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How can you use if-else statements to implement a branching algorithm?
Use if-else statements to create loops for repeated execution.
If-else statements are only used for error handling in programs.
Use if-else statements to evaluate conditions and execute different code blocks based on the truth value of those conditions.
If-else statements cannot evaluate multiple conditions at once.
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will the following code print: if 5 > 3: print('A') else: print('B')?
A
5
C
B
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
20 questions
PTS Genap Informatika Kelas XI
Quiz
•
11th Grade - University
10 questions
Tin 9 Bài 8. SUMIF
Quiz
•
9th Grade - University
16 questions
Kuis Uji Pemahaman Python Variabel, Sintaks Dasar, Type Data
Quiz
•
11th Grade - University
14 questions
Week 3-Database Quiz 1
Quiz
•
9th - 12th Grade
20 questions
Kelas 9 - Halaman 23 (UH Bab 1)
Quiz
•
9th Grade - University
20 questions
Defining Data Science
Quiz
•
11th Grade
20 questions
Python
Quiz
•
9th - 12th Grade
10 questions
0- and 1-Pixel Art Activity
Quiz
•
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
Discover more resources for Information Technology (IT)
20 questions
-AR -ER -IR present tense
Quiz
•
10th - 12th Grade
15 questions
Main Idea and Supporting Details.
Quiz
•
4th - 11th Grade
12 questions
Add and Subtract Polynomials
Quiz
•
9th - 12th Grade
13 questions
Model Exponential Growth and Decay Scenarios
Quiz
•
9th - 12th Grade
27 questions
7.2.3 Quadrilateral Properties
Quiz
•
9th - 12th Grade
7 questions
Amoeba Sisters Dihybrid Cross Punnett Square
Interactive video
•
9th - 12th Grade
10 questions
The Holocaust: Historical Overview
Interactive video
•
9th - 12th Grade
10 questions
Key Features of Quadratic Functions
Interactive video
•
8th - 12th Grade
