Question: Help with python Functions def count_odd_divisors (n): Given a positive int, find out how many odd numbers are divisors. o o o o o Assume:
Help with python


Functions def count_odd_divisors (n): Given a positive int, find out how many odd numbers are divisors. o o o o o Assume: n is a positive integer Restrictions: no extra restrictions. count-odd-divisors(15) count-odd-divisors(8) 4 1 2 # # # divisors: divisors: divisors: 1, 3, 5, 15 . 4 are odd 1, 2, 4,8. 1 is odd 1, 2, 3,4,6,12. 2 are odd count-odd-divisors(12) def inchworm(up, down, height): An inchworm is stuck in a well height feet deep. Starting at the bottom, climbs up up inches, then slides down down inches. How many upwards climbs does it take for the inchworm to reach the top and escape? (hint: if the top is reached, we don't slide back down!) Assume: up, down, and height are all non-negative int values. Restrictions: you must use a loop in your implementation to receive credit. inchworm(2,1,10) inchworm(18,100,8) o o 9 o inchworm(8,6,20) 7 def count_max(xs): Given a list of numbers, how many times does the largest value occur? If the list is empty, return zero. o Assume: xs is a sequence of any length, and all values are numbers. o Restrictions: remember, you may not call count(),max() or other related built-in functions. o count, max([ 5,1, 5, 2, 5, 3, 5]) 4 largest is 5; it occurs 4 times o count max (7,7,7,8]) o count_max([]) 1 largest is 8; it occurs once no max value; it occurs zero times def embedded_sounds (msg): We define a sound as a single vowel with a consonant on each side of it (exactly three letters long; upper and lowercase all used). Given a message string or arbitrary length, construct the list containing all embedded sounds from the message, in the order they appear Assume: msg is a string of any length. There are only five vowels: "aeiou" Restrictions: no extra restrictions. embedded-sounds("HOTDOG") embedded-sounds("totoro") embedded-sounds( "George o o ["HOT","DOG"] ("tot","tor"] o Mason University") ["Mas", "son", "niv""ver", "sit"]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
