
Understanding Python Collections: Lists, Sets, Tuples
Quiz
•
Computers
•
University
•
Practice Problem
•
Hard
Sherif Abdelhamid
FREE Resource
Enhance your content in a minute
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following data structures in Python is ordered and mutable?
List
Set
Tuple
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the correct syntax to create a set in Python?
`set = {1, 2, 3}`
`set = [1, 2, 3]`
`set = (1, 2, 3)`
`set = <1, 2, 3>`
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following operations is not allowed on a tuple?
Indexing
Slicing
Appending
Concatenation
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following code snippet? ```python my_list = [1, 2, 3, 4] my_list.append(5) print(my_list) ```
`[1, 2, 3, 4]`
`[1, 2, 3, 4, 5]`
`[5, 1, 2, 3, 4]`
`Error`
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following methods can be used to remove an element from a set?
`remove()`
`discard()`
`pop()`
All of the above
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the result of the following expression? ```python {1, 2, 3} | {3, 4, 5} ```
`{1, 2, 3, 4, 5}`
`{3}`
`{1, 2, 3}`
`{4, 5}`
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How can you access the third element of a tuple `t = (10, 20, 30, 40)`?
`t[2]`
`t[3]`
`t[1]`
`t[-1]`
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
STM 2013 : FORMATIF T3-FORM & REPORT
Quiz
•
University
12 questions
Python Quiz 1.4
Quiz
•
University
10 questions
Tes Awal Modul 5 CC
Quiz
•
University
10 questions
Logika Fuzzy
Quiz
•
University
20 questions
DWDM-2
Quiz
•
University
10 questions
Tree and Planar Graph
Quiz
•
University
10 questions
Bài 25 tin 10
Quiz
•
9th Grade - University
10 questions
Understanding Email, Contacts and Calendaring
Quiz
•
University
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
