Answered step by step
Verified Expert Solution
Question
1 Approved Answer
IN PYTHON Problem 1: Given a list of strings, convert each string to numerical values, then calculate the average. If the string does not correspond
IN PYTHON
Problem 1: Given a list of strings, convert each string to numerical values, then calculate the average. If the string does not correspond to a numerical value, ignore it. Note: if the list is empty, average is 0.0. For example, given a list [13, 36, "ABC", 20.3], your program will convert it to [13, 36, 20.3], and then output the average: 23.1 Test your program with the following lists, attach your input/output test runs as comments at the end of your program. (1) [13, 36, 20.3] (2) ["13.1.2", "3BYEs", "iPhone8", "$30.50"] Problem 2: A. Write a function checkSize() that takes a list of strings as a parameter and converts each element to its correspoinding size/length. Then return the result list. For example, if the list is ["Hello", "4.3", "35"], the result list is [5, 3, 2] B. Write a main function that initializes the following list, calls the checkSize function for that list, and prints out the result list. line1 = [3.5, "4.3", "3", Hi, "5000", "True"]
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