Question: uStioh 12 (20 points) area' is Write a function nam divergent and how many are not divergent, but the wor ins and ends with the
uStioh 12 (20 points) area' is Write a function nam divergent and how many are not divergent, but the wor ins and ends with the same letter of the alphabet. For example, the word d 'land' is not. ed getDivergent that computes and returns how many words in a list of words are Input: The function getDivergent takes a single parameter, words, that is a list of non-empty, lowerase strings Output: The function getDivergent should return a pair of integers in the form of a tuple, the first being the number of divergent words in words and the second being the number of non-divergent w words. ords in For example, the following would be correct output 'is', 'exercise'] >>> advice ['the', 'secret', 'to", >>print (getDivergent (advice)) (3, 5) 'a','better','health', Question 13 (20 points) Write a function named printLines. The function printlines should: takes one parameter: a string named Line prompt the user for an item of input: the number of times to print Line produce two kinds of output. It should: 1. print out Line the desired number of times 2. return the total number of lines it printed For example, the following would be correct input and output: Number of repetitions? 3 >>> print(count)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
