Write a function map(function, seq) that models a limited version of the behavior of the built-in function.
Fantastic news! We've Found the answer you've been seeking!
Question:
Write a function map(function, seq) that models a limited version of the behavior of the built-in function.
Input: a function function and a sequence seq.
Output: a list comprising the output of function for each element in seq. The order of seq must be maintained. If seq is empty, return an empty list.
Note: Remember that a sequence can be a list, a string, a tuple, or a range, so this function must work for all these types.
Related Book For
Discrete Time Signal Processing
ISBN: 978-0137549207
2nd Edition
Authors: Alan V. Oppenheim, Rolan W. Schafer
Posted Date: