
python

Quiz
•
Education
•
Professional Development
•
Medium
Auzoom four
Used 1+ times
FREE Resource
16 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the time complexity of accessing an element by index in a list in Python?
a) O(1)
b) O(n)
c) O(log n)
d) O(n^2)
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will the following code output?
lst = [1, 2, 3, 4]
lst[1:3] = [9, 8]
print(lst)
[1, 9, 8, 4]
[1, 2, 9, 8, 4]
[1, 9, 8]
Error
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code?
lst = [1, 2, 3]
lst.insert(1, 10)
print(lst)
a) [1, 10, 2, 3]
b) [10, 1, 2, 3]
c) [1, 2, 3, 10]
d) Error
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How would you remove all elements from a list lst?
a) lst.clear()
b) lst.remove()
c) lst.delete()
d) lst.reset()
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will the following code output?
lst = [5, 10, 15, 20]
lst[1:3] = [8, 12]
print(lst)
a) [5, 8, 12, 20]
b) [5, 8, 12, 15, 20]
c) [5, 8, 12]
d) [5, 8, 12, 15, 20]
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following code?
my_set = {1, 2, 3, 4, 5}
my_set.add(5)
print(my_set)
a) {1, 2, 3, 4, 5}
b) {5, 1, 2, 3, 4}
c) {1, 2, 3, 4, 5, 5}
d) Error
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the result of the following operation?
a = {1, 2, 3}
b = {3, 4, 5}
result = a & b
print(result)
a) {1, 2}
b) {3}
c) {3, 4, 5}
d) {1, 2, 3, 4, 5}
Create a free account and access millions of resources
Similar Resources on Wayground
13 questions
Python Intermediate Quiz - 1

Quiz
•
8th Grade - Professio...
12 questions
Pausa activa sesión 9

Quiz
•
Professional Development
20 questions
MPSAS

Quiz
•
Professional Development
20 questions
Common Mistakes - Part C

Quiz
•
KG - Professional Dev...
12 questions
Parts of the body / Health problems

Quiz
•
1st Grade - Professio...
12 questions
Criminal Investigation Quiz

Quiz
•
Professional Development
18 questions
Comparative and Superlative Adjectives

Quiz
•
3rd Grade - Professio...
20 questions
ECCE QIZIZZZ 2

Quiz
•
KG - Professional Dev...
Popular Resources on Wayground
50 questions
Trivia 7/25

Quiz
•
12th Grade
11 questions
Standard Response Protocol

Quiz
•
6th - 8th Grade
11 questions
Negative Exponents

Quiz
•
7th - 8th Grade
12 questions
Exponent Expressions

Quiz
•
6th Grade
4 questions
Exit Ticket 7/29

Quiz
•
8th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade
20 questions
One Step Equations All Operations

Quiz
•
6th - 7th Grade
18 questions
"A Quilt of a Country"

Quiz
•
9th Grade