GITIKAMANDAL MockAssessment1 Python Batch1.2.
GITIKAMANDAL MockAssessment1 Python Batch1.2.
• 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: