>>> skipping(11) # 11 + 9 + 7 + 5 + 3 + 1 + 0
2. Write the recursive function fortyFives(n) that takes an integer greater or equal to 0 and returns an integer that represents the number of times that a 5 directly follows a 4 in the digits of n. You are not allowed to cast the integer into a string to slice portions of the number. Hint: Using floor division (//) and modulo(%) operations could be helpful here.
3. Write the recursive function flat(aList) that takes a possibly deep list and flattens it. The function should not mutate the original list. Hint: you can check if something is a list by using the built-in functions type() or isinstance()
>>> x = [3, [[5, 2]], 6, ]
[3, 5, 2, 6, 4]
[3, [[5, 2]], 6, ]
4. Write the recursive function missedChar(txt1, txt2) that takes two strings, txt1 and txt2, where txt1 is a substring of txt2, this means, all characters in txt1 appear in txt2 in the same order, but not necessarily all together, so txt1 is shorter than txt2. The function returns a string that contains the characters you need to add to txt1 to get txt2. The characters in the output string should be in the order you have to add them from left to right. If there are multiple characters in txt2 that could correspond to characters in txt1, use the leftmost one. For example, if txt1 = 'cop' and txt2 = 'conception', then the function should return 'ncetion', not 'cnetion' because the first 'c' in 'cop' corresponds to the first 'c' in 'conception'. Hint: Slicing could be helpful here.
'treise' # We need to add these characters to 'at' to get 'treatise'
This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.def skipping(n):
# if n is 0, return 0
if n <= 0:
return n + skipping(n - 2)...