0% found this document useful (0 votes)
12 views2 pages

Python_Homework_List_Tuple_Set_Dict

This document is a Python homework assignment focused on data types including lists, tuples, sets, and dictionaries. It consists of matching descriptions to data types, filling in blanks, writing code examples, and answering questions about the behavior of these data types. The assignment is structured in four parts to assess understanding and application of Python data structures.

Uploaded by

Pankaj Navale
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views2 pages

Python_Homework_List_Tuple_Set_Dict

This document is a Python homework assignment focused on data types including lists, tuples, sets, and dictionaries. It consists of matching descriptions to data types, filling in blanks, writing code examples, and answering questions about the behavior of these data types. The assignment is structured in four parts to assess understanding and application of Python data structures.

Uploaded by

Pankaj Navale
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Python Homework: List, Tuple, Set, Dictionary

Name: ______________________ Date: ______________________

PART 1: Match the Items

Match the correct data type to its description.

1. A basket that doesn't allow repeats. ________

2. A collection you can't change. ________

3. Has keys and values like a mini glossary.________

4. You can add, remove, and keep order. ________

PART 2: Fill in the Blanks

1. A list uses __________ brackets.

2. A set cannot have __________ items.

3. A dictionary uses __________ pairs.

4. A tuple is __________ (changeable / unchangeable).

PART 3: Write the Code

Q1. Make a list of your 3 favorite fruits and print them.

# Your code here:

Q2. Make a tuple with 3 shapes: 'circle', 'square', 'triangle'

# Your code here:

Q3. Create a set of numbers: 1, 2, 2, 3, 4, 4 and print it.

Page 1
Python Homework: List, Tuple, Set, Dictionary

# Your code here:

Q4. Create a dictionary of a student with name, age, and grade.

# Your code here:

PART 4: Answer These Questions

1. What happens when you try to add a duplicate to a set?

Answer: ____________________________

2. Can you change a value inside a tuple?

Answer: ____________________________

3. How do you get a value from a dictionary?

Answer: ____________________________

4. Which one is best to use if you want to match a 'word' to its 'meaning'?

Answer: ____________________________

Page 2

You might also like