Contact: aviboots(AT)netvision.net.il
39,972 questions
51,915 answers
573 users
from numpy import char lst = ['python', 'php', 'java', 'c++', 'c'] result = char.str_len(lst) print(result) ''' run: [6 3 4 3 1] '''
lst = ['python', 'php', 'java', 'c++', 'c'] result = [*map(len, lst)] print(result) ''' run: [6, 3, 4, 3, 1] '''
lst = ['python', 'php', 'java', 'c++', 'c'] result = [len(val) for val in lst] print(result) ''' run: [6, 3, 4, 3, 1] '''