"""Given this list of namesReturn a new list with the string"Your instructor is " + each value in the array,but only if the value is less than 5 characters"""names = ['Lassie', 'Colt', 'Rusty']# My approachfiltered = (filter(lambda x : len(x) < 5, names)) # no need to convert to list, <filter object at 0x7f8b5da44340>ans = list(map(lambda x: f"Your instructor is {x}", filtered))# ans = ['Your instructor is Colt']# same ans but using list cmprehension[f"Your instructor is {name}" for name in names if len(name) < 5]
List Comprehension is better in this example… but it’s still important to know that functions like map, filter exist
But still if you can use list com, then you should lol