Session 5

Session 5

University

13 Qs

quiz-placeholder

Similar activities

Mastering Python Control Flow

Mastering Python Control Flow

University

15 Qs

DSA (Quiz 1) Arrays and Linked Lists

DSA (Quiz 1) Arrays and Linked Lists

University

15 Qs

Coding With Python- Introductory Quiz

Coding With Python- Introductory Quiz

University

13 Qs

Getting Familiar with GIT and GITHUB

Getting Familiar with GIT and GITHUB

University

15 Qs

Тест з теми 'Списки – змінювані послідовності'

Тест з теми 'Списки – змінювані послідовності'

7th Grade - University

12 Qs

Python_Quiz_1

Python_Quiz_1

University

10 Qs

Python_MCQ_2

Python_MCQ_2

University

15 Qs

Python for loop/lists

Python for loop/lists

9th Grade - University

15 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?