python

python

Professional Development

16 Qs

quiz-placeholder

Similar activities

Final Online Test 2023

Final Online Test 2023

Professional Development

20 Qs

Review G3

Review G3

Professional Development

13 Qs

Belajar Google Form

Belajar Google Form

Professional Development

20 Qs

Soalan u-Pustaka

Soalan u-Pustaka

Professional Development

15 Qs

Quick Review

Quick Review

KG - Professional Development

15 Qs

Supply PKT_Cycle 2_May'23

Supply PKT_Cycle 2_May'23

Professional Development

15 Qs

Pretest

Pretest

Professional Development

15 Qs

General Orders

General Orders

Professional Development

11 Qs

python

python

Assessment

Quiz

Education

Professional Development

Medium

Created by

Auzoom four

Used 1+ times

FREE Resource

16 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the time complexity of accessing an element by index in a list in Python?



a) O(1)

b) O(n)

c) O(log n)

d) O(n^2)

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will the following code output?

lst = [1, 2, 3, 4]

lst[1:3] = [9, 8]

print(lst)

[1, 9, 8, 4]

[1, 2, 9, 8, 4]

[1, 9, 8]

Error

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following code?

lst = [1, 2, 3]

lst.insert(1, 10)

print(lst)

a) [1, 10, 2, 3]

b) [10, 1, 2, 3]

c) [1, 2, 3, 10]

d) Error

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How would you remove all elements from a list lst?

a) lst.clear()

b) lst.remove()

c) lst.delete()

d) lst.reset()

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will the following code output?

lst = [5, 10, 15, 20]

lst[1:3] = [8, 12]

print(lst)

a) [5, 8, 12, 20]

b) [5, 8, 12, 15, 20]

c) [5, 8, 12]

d) [5, 8, 12, 15, 20]

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following code?

my_set = {1, 2, 3, 4, 5}

my_set.add(5)

print(my_set)

a) {1, 2, 3, 4, 5}

b) {5, 1, 2, 3, 4}

c) {1, 2, 3, 4, 5, 5}

d) Error

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the result of the following operation?

a = {1, 2, 3}

b = {3, 4, 5}

result = a & b

print(result)

a) {1, 2}

b) {3}

c) {3, 4, 5}

d) {1, 2, 3, 4, 5}

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?