Question: PYTHON 3...please help and explain with comments.. fmt - Interpolate values into a string at specified points 1 def fmt(spec, values): Write a recursive function
PYTHON 3...please help and explain with comments..

fmt - Interpolate values into a string at specified points 1 def fmt(spec, values): Write a recursive function fmt (spec, values) that is a very simple variant of Python's str.format method. Here's an example of usage # your code here >>fmt "x-,y ", [10, 20]) x10, y-20' fmt (spec, values) returns a copy of the string spec where the Nth occurrence of "is replaced by the Nth value in values Assume that there are a sufficient number of values to fill al occurrences of "". If there are excess values, they are simply ignored Programming Requirements Solve this problem using recursion. IMPORTANT: You may not use str.format! You are allowed to use only the following programming constructs: if statements; . return statements; * assignment; recursive function calls (if you use any helper functions then these must all be recursive as well); comparison operations (, !-, etc.); list indexing and slicing; list concatenation/extension. Solutions that go outside these constructs, e.g., by using for/while loops or list comprehensions, will not get credit
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
