
Python Quiz
Quiz
•
Computers
•
12th Grade
•
Practice Problem
•
Hard
Standards-aligned
Jamisha McClain-Raymond
Used 1+ times
FREE Resource
Enhance your content in a minute
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Elijah, Ava, and Abigail are learning Python together. They came across this line of code: `print(type([1, 2, 3]))`. What will it output?
`
`
`
`
Answer explanation
The output of the code snippet is '
Tags
DOK Level 1: Recall
2.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Hey there, Charlotte! If you were to store a lovely poem or a fun story in Python, which data type would you typically use?
List
Dictionary
String
Tuple
Answer explanation
The Python data type typically used for storing textual data is String.
Tags
DOK Level 1: Recall
3.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Imagine Isla, Maya, and Emma are playing a game where they need to guess the number of unique numbers in a list. They are given the list [1, 2, 2, 3, 4, 4, 4]. What will `len(set([1, 2, 2, 3, 4, 4, 4]))` return?
7
4
5
3
Answer explanation
The code creates a set from the list [1, 2, 2, 3, 4, 4, 4], which removes duplicates. The set will have elements [1, 2, 3, 4], so the length of the set is 4.
Tags
DOK Level 2: Skill/Concept
4.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What does the `if` statement do in Python?
It loops through a block of code a specified number of times.
It stops the execution of the program.
It executes a block of code if a specified condition is true.
It declares a variable.
Answer explanation
The `if` statement in Python executes a block of code if a specified condition is true, highlighting the correct choice.
Tags
DOK Level 1: Recall
5.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What will be the output of the following code snippet? ```python x = 10 if x > 5: print("Greater") else: print("Smaller") ```
Greater
Smaller
Error
No output
Answer explanation
The code snippet checks if x is greater than 5, which is true (x=10), so it prints 'Greater'. Therefore, the correct output is 'Greater'.
Tags
DOK Level 2: Skill/Concept
6.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Which Python keyword is used to define a function?
`function`
`def`
`func`
`declare`
Answer explanation
The Python keyword used to define a function is `def`. It is used at the beginning of a function definition to indicate the start of the function block.
Tags
DOK Level 1: Recall
7.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Evelyn is working on a Python project and needs to calculate the square root of a number. Which syntax should she use to correctly return the square root in her function?
`return sqrt(x)`
`return x ** 0.5`
`return x^2`
`return x * x`
Answer explanation
The correct syntax to return the square root of a number in a Python function is 'return x ** 0.5'.
Tags
DOK Level 2: Skill/Concept
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
Mengenal Internet dan Jaringan Local
Quiz
•
12th Grade
15 questions
Vocabulary of Computer
Quiz
•
12th Grade
20 questions
Ôn tập học kỳ I
Quiz
•
9th - 12th Grade
15 questions
Asesmen Sumatif
Quiz
•
12th Grade
20 questions
Teknik Pengolahan Audio dan Video
Quiz
•
12th Grade
20 questions
Quiz Inf X.B
Quiz
•
10th Grade - University
10 questions
Excel
Quiz
•
11th - 12th Grade
15 questions
History of Computers
Quiz
•
6th - 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
