Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Part I - Functions Write a program to do the following: . Create two separate lists: [Female, M, 1, 4, Mail, 0, F] o [-23,1,35,52,23,0,1000]
Part I - Functions Write a program to do the following: . Create two separate lists: ["Female", "M", 1, 4, "Mail", 0, "F"] o [-23,1,35,52,23,0,1000] For each element in the first list, replace each element using the following rules: o Change the value to Female if the element is Female, F, or 1 o Change the value to Male if the element is Male, M, or 0 o Otherwise, change it to "Undefined" For each number in the second list, replace each element using the following rules: 0 Numbers between 0 and 20 (inclusive), change element to "Low" Numbers over 20 but less than or equal to 40, change element to "Medium" Numbers over 40 but less than or equal to 60, change element to "High" o Anything else, change element to "Out of range" Use two separate functions to clean these lists and print the results when you are finished. Use meaningful variables and comment your header with your name, date, and a short program description. Save the program as a *py file and copy and paste the output into a *.txt file and upload the files to
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