List,Tuples,Dictionary

List,Tuples,Dictionary

Professional Development

19 Qs

quiz-placeholder

Similar activities

KUIS BULAN K3 UP3 TAHUNA

KUIS BULAN K3 UP3 TAHUNA

Professional Development

15 Qs

Egzamin zawodowy styczeń 2024 - PART 3

Egzamin zawodowy styczeń 2024 - PART 3

Professional Development

20 Qs

1. Introduction to Railway Electrification Works

1. Introduction to Railway Electrification Works

Professional Development

15 Qs

C02 : INDUSTRIAL AUTOMATION SYSTEMS INTEGRATION

C02 : INDUSTRIAL AUTOMATION SYSTEMS INTEGRATION

Professional Development

20 Qs

Egzamin zawodowy styczeń 2024 - PART 4

Egzamin zawodowy styczeń 2024 - PART 4

Professional Development

20 Qs

Examen 2 de soldadura basica

Examen 2 de soldadura basica

Professional Development

16 Qs

Quiz Open House BEI IMT AERO

Quiz Open House BEI IMT AERO

Professional Development

17 Qs

Day 48-Nov 8-worksheet-Diploma-Rainfall data & mean precipitatio

Day 48-Nov 8-worksheet-Diploma-Rainfall data & mean precipitatio

Professional Development

15 Qs

List,Tuples,Dictionary

List,Tuples,Dictionary

Assessment

Quiz

Engineering

Professional Development

Practice Problem

Hard

Created by

geet s

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...

19 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Elements of a tuple can be accessed in the same way as list or string using

Indexing

Slicing

Both indexing and slicing

None of the above

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

init_tuple = ('Python') * 3

print(type(init_tuple))

A. <class ‘tuple’>

B. <class ‘str’>

C. <class ‘list’>

D. <class ‘function’>

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the below Python code?

a = {(1,2):1,(2,3):2}

print(a[1,2])

A. Key Error

B. {(2,3):2}

C.  1

D. {(1,2):1}

4.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Media Image

The code below has a Python function writing to a dictionary. What will it print in the end?

A. 1

B. 2

C. 3

D. 4

5.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

What will be the output of the Python code given below?

dict = {'c': 97, 'a': 96, 'b': 98}

for _ in sorted(dict):

print (dict[_])

A. 96 98 97

B. 96 97 98

C. 98 97 96

D. NameError

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

>>colors = ["red", "green", "burnt sienna", "blue"]

>> "yellow" in colors

What is the result of the yellow in colors expression?


ValueError: 'yellow' is not in list

4

3

False

7.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

What’s the main difference between Python lists and tuples?

Lists can hold any data type and tuples can only contain int and str objects.

Lists are immutable and tuples are mutable.

Lists are faster and tuples are slower.

Lists are mutable and tuples are immutable.

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?