
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
Create a free account and access millions of resources
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
Virtual Private Server
Quiz
•
12th Grade
15 questions
Class XI Basics
Quiz
•
11th - 12th Grade
12 questions
Bài 6: Lưu trữ và chia sẽ tệp tin trên Internet
Quiz
•
9th - 12th Grade
17 questions
Security and Ethics
Quiz
•
9th - 12th Grade
20 questions
Design your website
Quiz
•
7th - 12th Grade
13 questions
INTERNET CONNECTION
Quiz
•
12th Grade
11 questions
Unit 2, 1.3 Types of information access and storage devices
Quiz
•
12th Grade
15 questions
Problem Solving : Design Solution
Quiz
•
12th Grade
Popular Resources on Wayground
5 questions
This is not a...winter edition (Drawing game)
Quiz
•
1st - 5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
10 questions
Identify Iconic Christmas Movie Scenes
Interactive video
•
6th - 10th Grade
20 questions
Christmas Trivia
Quiz
•
6th - 8th Grade
18 questions
Kids Christmas Trivia
Quiz
•
KG - 5th Grade
11 questions
How well do you know your Christmas Characters?
Lesson
•
3rd Grade
14 questions
Christmas Trivia
Quiz
•
5th Grade
20 questions
How the Grinch Stole Christmas
Quiz
•
5th Grade
Discover more resources for Computers
26 questions
Christmas Movie Trivia
Lesson
•
8th Grade - Professio...
15 questions
Christmas Song Emoji Pictionary
Quiz
•
7th - 12th Grade
20 questions
Christmas Movies
Quiz
•
1st - 12th Grade
55 questions
CHS Holiday Trivia
Quiz
•
12th Grade
20 questions
Christmas Movie Trivia
Quiz
•
9th - 12th Grade
29 questions
christmas facts
Lesson
•
5th - 12th Grade
20 questions
Christmas Trivia
Quiz
•
5th - 12th Grade
20 questions
Stages of Meiosis
Quiz
•
9th - 12th Grade
