How to reverse the strings in a list of strings using lambda and map functions in Python

1 Answer

0 votes
lst = ['python', 'java' , 'php', 'c', 'c++', 'c#', 'vb.net']

lst = list(map(lambda s : s[::-1], lst))
 
print(lst)



'''
run:

['nohtyp', 'avaj', 'php', 'c', '++c', '#c', 'ten.bv']

'''

 



answered Feb 1, 2020 by avibootz

Related questions

1 answer 209 views
1 answer 234 views
1 answer 195 views
1 answer 207 views
1 answer 181 views
1 answer 126 views
...