Search Header Logo

Python-List

Authored by harshit shukla

Computers

8th Grade

Used 5+ times

Python-List
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Suppose list1 is [1, 3, 2, 4, 5, 2, 1, 0],

What is list1[-1]?

3

5

1

0

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Suppose list1 is [3, 4, 5, 20, 5], what is

 

print(list1.index(5))

3

2

IndexError: list index out of range

4

3.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Suppose list1 is [3, 4, 5, 20, 5.0, "5", 1, 3, 5, 5.0],

what is

 

print(list1.count(5))

2

3

4

5

4.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which of the following would give an error?

lista = []

lista = []*3

lista = [2, 8, 7,]

None of the Above

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Suppose list1 is [3, 4, 5, 20, 5, 25, 1, 3], what is list1 after

 

print(list1.[::-2])

[3, 1, 25, 5,

20, 5, 4, 3]

[3, 4, 5, 20, 5,

25, 1, 3]

[3, 25, 20, 4]

[1, 5, 5, 3]

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Suppose listExample is [5, 3, 8, 15, 4], what is listExample after

print(listExample.popitem())

AttributeError: 'list' object has

no attribute 'popitems'

[5, 3, 8, 15, 4]

[5, 3, 8, 15]

[3, 8, 15, 4]

7.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Select the correct options to join two lists in Python.

list1 = [‘a’, ‘b’, ‘c’, ‘d’]
list2 = [‘e’, ‘f’, ‘g’]

Can have multiple correct Answers

newList =

list1 * list2

newList =

list1 + list2

newList.extend

(list1, list2)

newList = extend(list1, list2)

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?