0% found this document useful (0 votes)
2 views1 page

Homework List Tuple Set Raj

The document is an internship daily diary for a student named Raj at K.P. Patil Institute of Technology, detailing homework assigned by the industry mentor on the differences between List, Tuple, and Set in Python. It includes definitions, syntax, characteristics, methods, and examples for each data structure. The conclusion summarizes the appropriate use cases for Lists, Tuples, and Sets.

Uploaded by

rajmane5457
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)
2 views1 page

Homework List Tuple Set Raj

The document is an internship daily diary for a student named Raj at K.P. Patil Institute of Technology, detailing homework assigned by the industry mentor on the differences between List, Tuple, and Set in Python. It includes definitions, syntax, characteristics, methods, and examples for each data structure. The conclusion summarizes the appropriate use cases for Lists, Tuples, and Sets.

Uploaded by

rajmane5457
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

Sadguru Rahamana Shikshan Prasarak Mandal's

[Link] INSTITUTE OF TECHNOLOGY


(DTE CODE: 6814) (MSBTE Code: 1661)
Approved by AICTE, DTE Mumbai & Govt. of Maharashtra, Affiliated to MSBTE Mumbai

Internship Daily Diary (2026-2027)


Department of Artificial Intelligence and Machine Learning

Student Name : Raj Week No : 2

Faculty Mentor : Mr. Digvijaysigh Suryavanshi Industry Mentor : Ms. Snehal Jakhale

Company : Platominds Services Pvt. Ltd., Kolhapur Date : 06/06/2026

■ HOMEWORK — Differences between List, Tuple and Set in Python

Assigned by Industry Mentor: Ms. Snehal Jakhale | Topic: Difference between List, Tuple and Set

Feature List Tuple Set

Ordered, mutable collection of Ordered, immutable collection of Unordered, mutable collection of


Definition
items items unique items

Syntax list = [1, 2, 3] tup = (1, 2, 3) s = {1, 2, 3}

Ordered ■ Yes ■ Yes ■ No

Mutable (Changeable) ■ Yes ■ No ■ Yes

Duplicate Values ■ Allowed ■ Allowed ■ Not Allowed

Indexing / Slicing ■ Supported ■ Supported ■ Not Supported

Bracket Type [ ] Square ( ) Round { } Curly

Speed Slower than Tuple Faster than List Fast for membership test

Memory More memory Less memory More memory (hash table)

append(), insert(), remove(), count(), index() only (cannot add(), remove(), union(),
Methods
pop(), sort(), reverse(), etc. modify) intersection(), difference(), etc.

When data needs to be changed When data should remain When unique values are needed
Use Case
frequently constant (fixed records) (remove duplicates)

Iteration ■ Yes ■ Yes ■ Yes

Nested ■ Yes ■ Yes ■ Not directly

Type Function list() tuple() set()

Python Code Examples:

List Example: Tuple Example: Set Example:


my_list = [10, 20, 30, 20] my_tuple = (10, 20, 30, 20) my_set = {10, 20, 30, 20}
my_list.append(40) print(my_tuple[1]) my_set.add(40)
my_list[0] = 99 print(my_tuple.count(20)) print(my_set)
print(my_list) # Output: 20 # Output: {10, 20, 30, 40}
# Output: [99, 20, 30, 20, 40] # Output: 2 # (no duplicates, unordered)

Conclusion: Use List when you need an ordered, changeable collection. Use Tuple when data should not be changed (e.g.,
coordinates, DB records). Use Set when you need only unique values or fast membership testing.

Student Signature: Faculty Remark / Signature: Industry Mentor Signature & Stamp:

You might also like