I'm thinking of ways to convert a more complex function to lambda and put it inside a map instead of f. The function is this:
#this function should be in lambda
def f(s):
if (type(s) == int):
return s*2
else:
return s.replace('r', '*')
lst = [4,5,6,'rer', 'tr',50,60]
lst = list(map( f, lst))
#result of lst is [8, 10, 12, '*e*', 't*', 100, 120]
#lst = list(map ( lambda x.... , lst))
Or lambda is only supposed to deal with short functions? Big ones have to be 'decomposed' out into separate functions?