Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I need a solution to both of these: What does the following function do? def myFunction(words): result =[] for i in words: result.append(len(i)) print(result) Hint:
I need a solution to both of these:
What does the following function do? def myFunction(words): result =[] for i in words: result.append(len(i)) print(result) Hint: words is a list of words A. Prints the length of the last word in the list B. Prints a list with the lengths of all the words in the list C. Prints the total length of all the words in the list D. Prints a list with each word followed by its length What will the following function do? def myFunction(one, two): for a in one: for b in two: if a==b: return True return False Hint: the function will take in 2 lists of numbers as input A. Returns True if there is at least one identical element in each list B. Returns True if there is exactly one identical element in each list C. Returns True if there is at least one identical element in both lists at the same index
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