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 206 views
1 answer 231 views
1 answer 191 views
1 answer 204 views
1 answer 176 views
1 answer 120 views
...