Search Header Logo

Python List Quiz

Authored by Talent Ltd

Computers

10th Grade

Used 13+ times

Python List Quiz
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

21 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the correct way to create a list in Python?

list = (1, 2, 3)

list = [1, 2, 3]

list = {1, 2, 3}

list = 1, 2, 3

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How can you access the second element of a list `my_list`?

my_list[1]

my_list[2]

my_list[-1]

my_list[0]

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you append an element `4` to a list `numbers`?

numbers.add(4)

numbers.append(4)

numbers.insert(4)

numbers.extend(4)

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of `print([1, 2, 3] + [4, 5, 6])`?

[1, 2, 3, 4, 5, 6]

1, 2, 3, 4, 5, 6

[1, 2, 3][4, 5, 6]

123456

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you remove an element from a list by its value?

list.remove(value)

list.pop(value)

list.delete(value)

list.discard(value)

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a valid variable name in Python?

2nd_value

variable name

_value

value#1

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What will be the output of the following code?

x = 10

y = x

y =

y + 5

print(x)

10

15

5

0

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

Microsoft

Continue with Microsoft

or continue with

Facebook

Facebook

Apple

Apple

Others

Others

By signing up, you agree to our Terms of Service & Privacy Policy

Already have an account?