Python-list,tuple,Dictionary

Python-list,tuple,Dictionary

11th - 12th Grade

7 Qs

quiz-placeholder

Similar activities

Word App: Working with Tables and Charts Quiz

Word App: Working with Tables and Charts Quiz

9th - 12th Grade

10 Qs

Quiz on 19 Dec

Quiz on 19 Dec

11th Grade

10 Qs

MIL_GAME

MIL_GAME

12th Grade

10 Qs

Data Handling in Python

Data Handling in Python

11th Grade

10 Qs

Lesson 12-Working with Camera Raw

Lesson 12-Working with Camera Raw

9th - 12th Grade

9 Qs

PYTHON BASIC 8 - 9

PYTHON BASIC 8 - 9

12th Grade

10 Qs

Imaging and Design

Imaging and Design

11th Grade

10 Qs

JSPS Competition Hackathon - HTML Language Grade 4 & 5

JSPS Competition Hackathon - HTML Language Grade 4 & 5

4th Grade - University

10 Qs

Python-list,tuple,Dictionary

Python-list,tuple,Dictionary

Assessment

Quiz

Computers

11th - 12th Grade

Practice Problem

Hard

Created by

shruthi Hegde

Used 156+ times

FREE Resource

AI

Enhance your content in a minute

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

7 questions

Show all answers

1.

MULTIPLE SELECT QUESTION

20 sec • 1 pt

1. Examples for list data type

[1,2,3,4,5]

['S','H','R','U','T','H','I']

{1:"a",2:"b",3:"c",7:"d"}

('A','B','C','D')

2.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

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

print(colors[2])


What is the output of the above python code?

'blue'

It causes a run-time error.

'burnt sienna'

'green'

3.

FILL IN THE BLANK QUESTION

20 sec • 1 pt

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


Which list index would select the value 'red' from the above list?

4.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

colors = ("red", "green", "burnt sienna", "blue")


print("yellow" in colors)


What is the result of the yellow in colors expression?

ValueError: 'yellow' is not in list

4

False

True

5.

MULTIPLE CHOICE QUESTION

30 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 mutable and tuples are immutable.

Lists are faster and tuples are slower.

Check Your Answer »

6.

MULTIPLE SELECT QUESTION

30 sec • 1 pt

Which of the following are true of Python dictionaries:

Dictionaries are accessed by key.

All the keys in a dictionary must be of the same type.

Dictionaries are mutable.

A dictionary can contain any object type except another dictionary.

Dictionaries can be nested to any depth.

7.

FILL IN THE BLANK QUESTION

1 min • 1 pt

Write the Python code that prints out Captain Kirk’s email address from the employee dictionary below:


employee = { "id": 1701, "name": "James T Kirk",

"email": "jtkirk@starfleet.com","position": "captain"}


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?