List

List

12th Grade

7 Qs

quiz-placeholder

Similar activities

Arrays Intro

Arrays Intro

9th - 12th Grade

12 Qs

Loops

Loops

9th - 12th Grade

10 Qs

While loop

While loop

3rd Grade - University

9 Qs

Master curs 1

Master curs 1

12th Grade

10 Qs

Pyflask2020

Pyflask2020

KG - Professional Development

10 Qs

Quiz1_HPB2021_2010t1

Quiz1_HPB2021_2010t1

1st - 12th Grade

10 Qs

Lists and Tuples

Lists and Tuples

12th Grade

10 Qs

Revision Quiz Std 12 Jan 19 2021

Revision Quiz Std 12 Jan 19 2021

12th Grade

10 Qs

List

List

Assessment

Quiz

Computers

12th Grade

Hard

Created by

Dhilma Dhilma

Used 1+ times

FREE Resource

7 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following Python code?

names = ['Amir', 'Bear', 'Charlton', 'Daman']

print(names[-1][-1])

A

Daman

n

Amir

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What will be the output of the following Python code?

11

12

21

22

Answer explanation

When assigning names1 to names2, we create a second reference to the same list. Changes to names2 affect names1. When assigning the slice of all elements in names1 to names3, we are creating a full copy of names1 which can be modified independently.

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Suppose list1 is [1, 3, 2],

What is list1 * 2?

[2, 6, 4]

[1, 3, 2, 1, 3]

[1, 3, 2, 1, 3, 2]

[1, 3, 2, 3, 2, 1]

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Suppose list1 = [0.5 * x for x in range(0, 4)],

list1 is:

[0, 1, 2, 3]

[0, 1, 2, 3, 4]

[0.0, 0.5, 1.0, 1.5]

[0.0, 0.5, 1.0, 1.5, 2.0]

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

To insert 5 to the third item in list1, we use which command?

list1.insert(3, 5)

list1.insert(2, 5)

list1.add(3, 5)

list1.insert(5, 2)

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Suppose listExample is [3, 4, 5, 20, 5, 25, 1, 3],

what is list1 after listExample.pop(1)?

[3, 4, 5, 20, 5, 25, 1, 3]

[3, 4, 5, 20, 5, 25, 1]

[3, 5, 20, 5, 25, 1, 3]

[4, 5, 20, 5, 25, 1, 3]

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following Python code?

list("a#b#c#d".split('#'))

[‘a’, ‘b’, ‘c’, ‘d’]

[‘a b c d’]

[‘a#b#c#d’]

[‘abcd’]