Which of the following are true of Python lists?

Session 5

Quiz
•
Information Technology (IT)
•
University
•
Hard

Mimansha Ramcharn
Used 5+ times
FREE Resource
13 questions
Show all answers
1.
MULTIPLE SELECT QUESTION
45 sec • 1 pt
All elements must be of the same type
These represent the same list: ['a', 'b', 'c'] and ['c', 'a', 'b']
A list may contain any type except another list
There is no conceptual limit to the size of a list
A given object may appear in a list more than once
2.
MULTIPLE SELECT QUESTION
45 sec • 1 pt
List a is defined as follows: a = [1, 2, 3, 4, 5]
Statements that remove the middle element 3 from a:
a.remove(3)
del a[2]
a[2] = [ ]
a[2:2] = [ ]
a[2:3] = [ ]
3.
MULTIPLE SELECT QUESTION
45 sec • 1 pt
List a is defined as follows: a = ['a', 'b', 'c']
To add 'd' and 'e' to the end, so that the answer is a = ['a', 'b', 'c', 'd', 'e']
Which statements are true?
a += ['d', 'e']
a.append(['d', 'e'])
a = ['a', 'b', 'c', 'd', 'e']
a[len(a):] = ['d', 'e']
4.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Which function counts elements in a list?
find()
index()
count()
len()
5.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Let list1 = [2, 4, 6, 8, 10].
What will print(list1[-2]) result in?
6
8
error
-2
6.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Which statement is NOT correct?
A list is mutable
The append function is used to add an element
A tuple is immutable
The extend function adds an element to a tuple
7.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Can lists contain tuples and vice versa?
Yes
No
Create a free account and access millions of resources
Similar Resources on Quizizz
16 questions
Q3. Relational Model

Quiz
•
University
12 questions
eXtensible Markup Language

Quiz
•
12th Grade - University
15 questions
Quiz Instalasi dan Penggunaan Python

Quiz
•
University
16 questions
Minecraft Education Edition Basics Quiz

Quiz
•
7th Grade - University
10 questions
Pretest Minggu 4

Quiz
•
University
11 questions
Python (basics)

Quiz
•
1st Grade - University
10 questions
Week3 上周知识点回顾

Quiz
•
University
15 questions
Join by Madi

Quiz
•
University
Popular Resources on Quizizz
15 questions
Character Analysis

Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
10 questions
American Flag

Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension

Quiz
•
5th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25

Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers

Quiz
•
6th - 8th Grade