[go: up one dir, main page]

0% found this document useful (0 votes)
1 views4 pages

GITIKAMANDAL MockAssessment1 Python Batch1.2.

Uploaded by

gitika.mandal012
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)
1 views4 pages

GITIKAMANDAL MockAssessment1 Python Batch1.2.

Uploaded by

gitika.mandal012
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/ 4

GITIKAMANDAL_MockAssessment1_Python_Batch1.2.

PROGRAM 4: : List Methods — Clean & Normalize Shopping List Objective:


Use only list methods (append, extend, insert, remove, pop, index, count,
sort, reverse, slicing).
Requirements:

• Input: a raw list like [" Milk", "eggs", "MILK ", "bread", "Eggs", " butter "].
Trim whitespace, convert to lowercase, and remove duplicates while
preserving order (no set).
• Print final sorted list and also reversed order.
OUTPUT:
PROGRAM 3: File Handling Utility – Text Analyzer Objective: Read sample
.txt file and display all Unique cities sample.txt ( copy the below to
sample.txt file ) EmpID, Name, Department, Location E1001,Asha Rao,
Data Science, Mumbai E1002,Rahul Mehta, IT Support, Hyderabad
E1003,Neha Singh, Human Resources, Hyderabad E1004,Vikram
Das,Finance, Mumbai E1005,Priya Kapoor, Marketing, Hyderabad
Requirements:

• Ask the user for a file path; open safely with try/except for
FileNotFoundError.
• Use if condition whereever required
• Use user defined function
OUTPUT:

You might also like