Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The csv file is pasted below the instructions! Help!Prompt user to give you name of the csv file. Csv file comes in this format, id
The csv file is pasted below the instructions! Help!Prompt user to give you name of the csv file. Csv file comes in this format, id firstname, lastname, age, city, phonenumber
You can always assume, csv file will have data and it will be in the same format shown above.
For testing purposes you can use this file: data.csv
Download data.csv
If file was found, proceed to show these filtering options.
filter by age
a user must enter min and max age, show all rows that have age between min and max including the min and max number.
b if user entered the same number for min and max, that means user is looking for a row specifically for that age
c you must do checking where min shouldn't be greater than max. And min cannot be less than
filter by city
a once user enters city, present with all data that matches the city name, if none exist, just show a message saying no data found.
filter by last name
a once user enters last name, present with all data that matches the last name, if none exist, just show a message saying no data found.
filter by first name
a once user enters first name, present with all data that matches the first name, if none exist, just show a message saying no data found.
filter by id
a same rules like age but with id instead.
Q to quit.
If data was filtered, give user an option to save filtered data.
Ex:
Please enter csv file name or Q to exit: test
File was not found.
Please enter csv file name or Q to exit: data.csv
File found.
Here are your filtering options:
Filter by age min and max
Filter by city
Filter by last name
Filter by first name
Filter by id min and max
or enter Q to quit
Please give min age for filtering:
Please give max age for filtering:
Max cannot be less than min!
Please give max age for filtering:
Here is the filtered data based on age between and inclusively.
User ID:
Alex Anderson
Omaha, NE
User ID:
Seth Green
Denver, CO
If no data was found, print a message saying no data was found, then move on to asking about going back to the main menu
Would you like to save the filtered data? YN
Y
What should the name of the new file be
filteredage
Your filtered data was saved in filteredage.csv this must output a file with filtered data above saved in the same format as the original data.
Would you like to go back to the main menu? YN
N
Terminating program. Good bye!
There is a lot of repetitive functionality in this assignment, I am expecting you to be very efficient with your solutions. Utilize for loop, while loop and functions to reuse your code.
Your submission MUST include this file:
main.py must have main function in itid firstname lastname age city phonenumber
John Doe New York
Jane Smith Los Angeles
Michael Johnson Chicago
Emily Brown Houston
William Jones Miami
Sophia Lee San Francisco
Alexander Wilson Seattle
Olivia Miller Boston
Daniel Moore Atlanta
Isabella Anderson Dallas
Ethan Thomas Denver
Mia Jackson Phoenix
James White Austin
Ava Harris San Diego
Benjamin Martin Portland
Sofia Thompson Philadelphia
Elijah Garcia Detroit
Chloe Martinez Minneapolis
Logan Robinson Charlotte
Amelia Clark Orlando
Lucas Rodriguez Phoenix
Luna Lopez Miami
Henry Hall Chicago
Harper Young Atlanta
William King Seattle
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started