Search Header Logo

Python LIST

Authored by Sharfuddin Mohammed

Education

9th - 12th Grade

Used 1+ 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

30 sec • 1 pt

Which of these is not a core data type?

LIst

Dictionary

Class

Tuple

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following code snippet?

my_list = [3, 6, 9]

my_list.append(12)

print(len(my_list))

3
4
5
6

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following methods can be used to add multiple elements to a list at once?

append()
extend()
insert()
pop()

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will my_list[-1] return?

The last item in the list
The first item in the list
An error
The second item in the list

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following methods removes the first occurrence of a specific value from a list?

remove()
delete()
pop()
discard()

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the result of the following code?

numbers = [1, 2, 3, 4, 5]

squared = [num ** 2 for num in numbers]

print(squared)

[1, 4, 9, 16, 25]
[1, 2, 3, 4, 5]
[2, 4, 6, 8, 10]
[1, 3, 5, 7, 9]

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following statements is true about Python lists?

a) Lists in Python are fixed-size, meaning their length cannot change after creation.

b) Lists can contain elements of different data types in a single list.

c) Lists in Python can only store integers and strings.

d) Lists are created using curly braces {}.

Lists in Python are fixed-size, meaning their length cannot change after creation.
Lists can contain elements of different data types in a single list.
Lists in Python can only store integers and strings.
Lists are created using curly braces {}.

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?