Python Quiz: Lists, Dicts, Sets, and More

Python Quiz: Lists, Dicts, Sets, and More

2nd Grade

50 Qs

quiz-placeholder

Similar activities

AP Java Quiz 1

AP Java Quiz 1

KG - University

50 Qs

Assessment preparatory quiz

Assessment preparatory quiz

1st - 5th Grade

49 Qs

ASKf2Bab3

ASKf2Bab3

2nd Grade

50 Qs

TUGAS KELAS 7 TIK

TUGAS KELAS 7 TIK

1st - 3rd Grade

55 Qs

Python Sınavı

Python Sınavı

1st - 5th Grade

50 Qs

LATIHAN SOAL PAT TIK KELAS 5

LATIHAN SOAL PAT TIK KELAS 5

1st - 5th Grade

50 Qs

Ulangkaji ASK T2 Bab 2 Algoritma

Ulangkaji ASK T2 Bab 2 Algoritma

1st - 12th Grade

47 Qs

GCSE Python Legends

GCSE Python Legends

1st - 12th Grade

45 Qs

Python Quiz: Lists, Dicts, Sets, and More

Python Quiz: Lists, Dicts, Sets, and More

Assessment

Quiz

Computers

2nd Grade

Hard

Created by

Beebi Naseeba

FREE Resource

50 questions

Show all answers

1.

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]

[5, 7, 9]

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

Error

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does list1.append(5) do?

Adds 5 to the end of list1

Inserts 5 at index 0

Deletes index 5

Raises an error

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of print(len([1, [2, 3], 4]))?

3

4

5

2

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

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

list.remove(value)

list.delete(value)

list.pop(value)

del list[value]

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the result of list1 = [1, 2, 3] and list1 * 2?

[1, 2, 3, 1, 2, 3]

[1, 2, 3, 2]

[1, 2, 3, 1]

[2, 4, 6]

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of dict1 = {'a':1, 'b':2}; print(dict1['a'])?

'a'

1

2

Error

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How can you get all the keys of a dictionary?

dict.keys()

dict.values()

dict.items()

dict.get()

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?

Discover more resources for Computers