Python-Lists_Dictionaries

Python-Lists_Dictionaries

University

20 Qs

quiz-placeholder

Similar activities

Excel_Test_bài 1

Excel_Test_bài 1

University

15 Qs

21CSC305P - Machnine Learning - Quiz

21CSC305P - Machnine Learning - Quiz

University

15 Qs

Pythonintro

Pythonintro

University

15 Qs

Email Lớp 6

Email Lớp 6

6th Grade - University

17 Qs

DAA quiz2

DAA quiz2

University

15 Qs

Kuis Dadakan ;)

Kuis Dadakan ;)

10th Grade - University

15 Qs

WINDOWS 2 ՊԱՏՈՒՀԱՆՆԵՐ

WINDOWS 2 ՊԱՏՈՒՀԱՆՆԵՐ

University

18 Qs

Multimedia Video & Animation

Multimedia Video & Animation

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