python apply a function on each element of a array

165

python apply a function on each element of a array -

>>> mylis = ['this is test', 'another test']
>>> [item.upper() for item in mylis]
['THIS IS TEST', 'ANOTHER TEST']

Comments

Submit
0 Comments