Session 5

Session 5

University

13 Qs

quiz-placeholder

Similar activities

Python Module-I Quiz

Python Module-I Quiz

University

10 Qs

Coding With Python- Introductory Quiz

Coding With Python- Introductory Quiz

University

13 Qs

Exploring Python Lists and Tuples

Exploring Python Lists and Tuples

University

10 Qs

Python for loop/lists

Python for loop/lists

9th Grade - University

15 Qs

NoSQL Concepts

NoSQL Concepts

University

10 Qs

Quiz về Kiểu Dữ Liệu List và Set (1)

Quiz về Kiểu Dữ Liệu List và Set (1)

7th Grade - University

15 Qs

Fundamentos de Programación en Python

Fundamentos de Programación en Python

6th Grade - University

10 Qs

Data Mining Methodologies and Applications

Data Mining Methodologies and Applications

University

10 Qs

Session 5

Session 5

Assessment

Quiz

Information Technology (IT)

University

Hard

Created by

Mimansha Ramcharn

Used 5+ times

FREE Resource

13 questions

Show all answers

1.

MULTIPLE SELECT QUESTION

45 sec • 1 pt

Which of the following are true of Python lists?

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

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?