
Exploring Python Lists and Tuples

Quiz
•
Information Technology (IT)
•
University
•
Hard
Ruby Chen
Used 1+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following operations can be performed on a Python list but not on a tuple?
Accessing elements by index
Appending elements
Iterating over elements
Checking membership with `in`
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following code snippet? ```python my_tuple = (1, 2, 3) my_tuple[1] = 4 ```
`(1, 4, 3)`
`(1, 2, 3)`
`TypeError`
`(4, 2, 3)`
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is a correct list comprehension to create a list of squares of numbers from 0 to 4?
`[x^2 for x in range(5)]`
`[x**2 for x in range(5)]`
`[x*2 for x in range(5)]`
`[x**2 for x in range(1, 5)]`
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the result of the following tuple unpacking? ```python a, b, c = (4, 5, 6) ```
`a = 4, b = 5, c = 6`
`a = 6, b = 5, c = 4`
`a = 5, b = 6, c = 4`
`a = 4, b = 6, c = 5`
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following slicing operation on a list? ```python my_list = [10, 20, 30, 40, 50] print(my_list[1:4]) ```
`[10, 20, 30]`
`[20, 30, 40]`
`[30, 40, 50]`
`[20, 30, 40, 50]`
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Consider the tuple slicing operation below. What will be the output? ```python my_tuple = (10, 20, 30, 40, 50) print(my_tuple[2:]) ```
`(10, 20, 30)`
`(30, 40, 50)`
`(20, 30, 40)`
`(40, 50)`
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following statements about tuples is true?
Tuples are mutable.
Tuples can contain duplicate elements.
Tuples do not support indexing.
Tuples can be resized.
Create a free account and access millions of resources
Similar Resources on Wayground
10 questions
Pretest Minggu 4

Quiz
•
University
15 questions
Quiz Instalasi dan Penggunaan Python

Quiz
•
University
13 questions
Matploblib en Python

Quiz
•
University
13 questions
Introduction To Programming - Lesson Exception Handling

Quiz
•
11th Grade - University
10 questions
ITKKU02

Quiz
•
University
10 questions
Scratch - základy

Quiz
•
6th Grade - University
15 questions
codingม.ต้น

Quiz
•
12th Grade - University
5 questions
Questionário 2.2

Quiz
•
University
Popular Resources on Wayground
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
10 questions
Ice Breaker Trivia: Food from Around the World

Quiz
•
3rd - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
20 questions
ELA Advisory Review

Quiz
•
7th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Multiplication and Division Unknowns

Quiz
•
3rd Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Information Technology (IT)
11 questions
NFL Football logos

Quiz
•
KG - Professional Dev...
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)

Quiz
•
8th Grade - University
7 questions
Force and Motion

Interactive video
•
4th Grade - University
36 questions
Unit 5 Key Terms

Quiz
•
11th Grade - University
38 questions
Unit 6 Key Terms

Quiz
•
11th Grade - University
20 questions
La Hora

Quiz
•
9th Grade - University
7 questions
Cell Transport

Interactive video
•
11th Grade - University
7 questions
What Is Narrative Writing?

Interactive video
•
4th Grade - University