Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please break down each problem and keep it as BASIC AS POSSIBLE! Having a hard time grasping the material and would like to understand it
Please break down each problem and keep it as BASIC AS POSSIBLE! Having a hard time grasping the material and would like to understand it so keep it brief. Please keep it concise and do not use any functions, shortcuts, short hands, as we have yet to learn any.
Lastly, please make sure you are checking the answers in the sample usage. Double check that the ALL the answers come out correct! Often times, I am finding incorrect answers and that does not help me.
Thank you!
Write a function doubl evowel that accepts a word as an argument and returns True if the word contains two adjacent vowels and False otherwise. Sample usage: doublevowel ('apple') False doublevowel ('pear') True >> doublevowel (' pear') True doublevowel ('DURIAN') True >> doublevowel ('banana') False doublevowel ('banana') ==FFalse True numpairs Write a function numpairs that accepts two arguments, a target number and a list of numbers. The function then returns the count of pairs of numbers from the list that sum to the target number. In the first example the answer is 2 because the pairs (0,3) and (1,2) both sum to 3 . The pair can be two of the same number, e.g. (2,2) but only if the two 2 's are separate twos in the list. In the last example below, there are three 2 's, so there are three different pairs (2,2) so there are 5 pairs total that sum to 4 . Sample usage: numpairs (3,[0,1,2,3]) 2 numpairs (4,[0,1,2,3]) 1 numpairs (6,[0,1,2,3]) 0 numpairs (4,[0,1,2,3,4,2]) 3 numpairs (4,[0,1,2,3,4,2,2]) 5 numpairs (4,[0,1,2,3,4,2,2])==5 True hideshow Write a function hideshow that accepts two string arguments, an input string and a masking string. The masking string is a string consisting of ' 0 's and '1's that has the same length as the input string. The function then returns a new string that is the same as the input string, excep that it is masked. That is, in any position where the masking string contains a ' 0 ' the input character is replaced by a ' # ', whereas if the masking string contains a ' 1 ', the character is unchanged. Sample usage: > hideshow ('apple' , '11001') ' ap## ' 2 >>> hideshow('apple', '00000') '\#\#\#\#\#' >>> hideshow('apple', '11111') 'apple' \> hideshow ('abcdefghi jkk mnopqrstuvwxyz' ,13*' 01 ) ' \#b\#d\#f\#h\#j\# 1\#n\#p\#r\#t\#v\#x\#z' >>> hideshow ( 'df\#\#\#re\#\#', '101010101') ' d#####e## \> hideshow ( 'df\#\#\#re\#\#', '101010101')=='d\#\#\#\#\#e\#\#' True clean Write a function clean that when is given a string and returns the string with the leading and trailing space characters removed. Details: - you must use while loop(s) - you must not use the strip method - the space characters are the space ' ', newline ' , and tab ' \t > clean(" he 170 ") 'he 170 clean(" he 170 , how are you? ") 'he 710 , how are you?' clean(" \t what's up, doc? \t) "what's up, doc?" clean (" \t what's up, doc? \t)==" what's up, \\ doc?" True Write a function sequence that accepts an number ( int) and that prints a sequence of numbers that starts at the given number and obeys the following rules: - the number 1 is the last number in the sequence (e.g stop) - if the number if even, the next number is half of it - if the number is odd, the next number is one more Specifications: - use a while loop - print each number in the sequence one per lineStep 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