How to use map to pad characters "_" to strings whose length is less?
My code:
lst = ['photo', 'music', 'magazine']
def all_eq(lst):
max_item = max(lst, key = lambda x: len(x))
max_len = len(max_item)
for i in lst:
if len(i) < max_len:
b = list(map(lambda x: x + "_", lst))
return b
print(all_eq(['photo', 'music', 'magazine']))