python practice 4

python practice 4

University

10 Qs

quiz-placeholder

Similar activities

MATEMATIKA (FUNGSI)

MATEMATIKA (FUNGSI)

University

15 Qs

Proposal Kelas 11

Proposal Kelas 11

University

8 Qs

Concurso de merito. RV Homonimia... 11-7-25

Concurso de merito. RV Homonimia... 11-7-25

University

15 Qs

Vocabulary Template

Vocabulary Template

University

15 Qs

:)))

:)))

1st Grade - University

10 Qs

Tugas Teorema Sisa III

Tugas Teorema Sisa III

10th Grade - University

10 Qs

Списки. PYTHON

Списки. PYTHON

3rd Grade - University

10 Qs

Lý thuyết về Python

Lý thuyết về Python

3rd Grade - University

10 Qs

python practice 4

python practice 4

Assessment

Quiz

Other

University

Medium

Created by

Assoc.Prof,IT Chennai

Used 1+ times

FREE Resource

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]

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?