Python-Lists_Dictionaries

Python-Lists_Dictionaries

University

20 Qs

quiz-placeholder

Similar activities

Relational Algebra and Calculus

Relational Algebra and Calculus

University

20 Qs

Pra UPS 2

Pra UPS 2

University

20 Qs

Quiz Inf X.B

Quiz Inf X.B

10th Grade - University

20 Qs

Redes Vlan

Redes Vlan

University

15 Qs

DWDM-2

DWDM-2

University

20 Qs

REDES

REDES

University

15 Qs

Kompyuter Arxitekturasi 3.0

Kompyuter Arxitekturasi 3.0

University

19 Qs

IGH Test de Entrada

IGH Test de Entrada

University

20 Qs

Python-Lists_Dictionaries

Python-Lists_Dictionaries

Assessment

Quiz

Computers

University

Practice Problem

Hard

Created by

Anik Acharjee

Used 3+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is the output of the following code?

   

   fruits = ['apple', 'banana', 'cherry']

   print(fruits[1])

 apple

banana

cherry

['apple', 'banana', 'cherry']

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

How do you add an element to the end of a list?

list.add(element)

list.append(element)

list.insert(element)

list.push(element)

3.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is the correct way to create an empty dictionary?

dict = {}

dict = []

dict = ()

dict = set()

4.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

How do you access the value of a key in a dictionary?

dict[key]

dict(key)

dict.get(key)

Both dict[key] and dict.get(key)

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is the output of the following code?

   numbers = [1, 2, 3, 4, 5]

   print(len(numbers))

4

 5

6

[1, 2, 3, 4, 5]

6.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

How do you remove the last element from a list?

list.remove()

list.pop()

list.delete()

list.cut()

7.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is the correct way to check if a key exists in a dictionary?

if key in dict:

if key exists in dict:

if dict.haskey(key):

if dict.contains(key):

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?

Discover more resources for Computers