
Python Practice Test #3
Authored by Matt Little
Other
Professional Development
Used 28+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
30 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
15 mins • 1 pt
What will be the output after running the following code?
func1
func3
func3
func3
func3
func1
func1
func2
func3
func3
func2
func1
2.
MULTIPLE CHOICE QUESTION
15 mins • 1 pt
What will be the output after running the following code?
[7, 2]
[7, 6, 5, 4, 3, 2]
[7, 3]
SyntaxError
3.
MULTIPLE CHOICE QUESTION
15 mins • 1 pt
What will be the output after running the following code?
Yes
True
error
No
4.
MULTIPLE CHOICE QUESTION
15 mins • 1 pt
What will be the output when the following program is run?
5,4,'Earth'
[5,4]
[5, 4, 'Earth']
{5,4,'Earth'}
5.
MULTIPLE CHOICE QUESTION
15 mins • 1 pt
What is the output of the following code:
<class 'tuple'>
<class 'list'><class 'int'>
<class 'list'>
error
6.
MULTIPLE CHOICE QUESTION
15 mins • 1 pt
What will the output be after executing this code?
True True False
False False True
False True False
False False False
Answer explanation
When bool() is provided an empty list, an empty string or the value 0 as an argument, it returns False. The expression will evaluate to True when bool () is given any other value, including negative numbers.
7.
MULTIPLE CHOICE QUESTION
15 mins • 1 pt
What is the output of the following print statement?
False
True
SyntaxError
10
Answer explanation
The is operator is an identity operator, it checks whether both the operands refer to the same object or not. The p and q have equal values, stored in the same memory location, hence p and q are same. You can use id() function to check if the variables are same: print(id(p)) print(id(q)) which will indicate the same ID for both variables.
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
25 questions
BT - Business Organization Structure
Quiz
•
Professional Development
25 questions
EFFICIENT CALENDAR MANAGEMENT
Quiz
•
Professional Development
25 questions
Physio Quizz 2024
Quiz
•
Professional Development
25 questions
BUSINESS SERVICES
Quiz
•
11th Grade - Professi...
25 questions
IoT Introduction
Quiz
•
Professional Development
25 questions
CHAPTER 3 - Sensor
Quiz
•
Professional Development
25 questions
Seberapa Inventory Kah Aku
Quiz
•
Professional Development
25 questions
Logo Quiz
Quiz
•
KG - Professional Dev...
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 Other
10 questions
How to Email your Teacher
Quiz
•
Professional Development
6 questions
3RD GRADE DECLARATION OF INDEPENDENCE EXIT TICKET
Quiz
•
Professional Development
19 questions
Black History Month Trivia
Quiz
•
6th Grade - Professio...
22 questions
Multiplying Exponents with the Same Base
Quiz
•
9th Grade - Professio...
40 questions
Flags of the World
Quiz
•
KG - Professional Dev...