Search Header Logo

python practice 4

Authored by Assoc.Prof,IT Chennai

Other

University

Used 1+ times

python practice 4
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

Which of the following commands will create a list?

list1 = list()

list1 = []

list1 = list([1, 2, 3])

all of the mentioned

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is the output when we execute list(“hello”)?

[‘h’, ‘e’, ‘l’, ‘l’, ‘o’]

[‘hello’]

[‘llo’]

[‘olleh’]

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Suppose list1 is [4, 2, 2, 4, 5, 2, 1, 0], Which of the following is correct syntax for slicing operation?

print(list1[2:])

print(list1[:2])

print(list1[:-2])

all of the mentioned

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Suppose list1 is [2, 33, 222, 14, 25], What is list1[-1]?

Error

None

25

2

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Suppose list1 is [3, 4, 5, 20, 5, 25, 1, 3], what is list1 after list1.reverse()?

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

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

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

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

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Suppose listExample is [3, 4, 5, 20, 5, 25, 1, 3], what is list1 after listExample.extend([34, 5])?

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

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

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

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

7.

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]

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

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

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

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?