Python map function tutorial example explained
#python #map #function
---------------------------------------------------------------------------------------------------------------
map() = applies a function to each item in an iterable (list, tuple, etc.)
# map(function,iterable)
store = [("shirt",20.00),
("pants",25.00),
("jacket",50.00),
("socks",10.00)]
to_euros = lambda data: (data[0],data[1]*0.82)
to_dollars = lambda data: (data[0],data[1]/0.82)
store_euros = list(map(to_euros, store))
for i in store_euros:
print(i)
---------------------------------------------------------------------------------------------------------------
Bro Code merch store 👟 :
===========================================================
https://teespring.com/stores/bro-code-5
===========================================================
On this page of the site you can watch the video online Python map 🗺️ with a duration of hours minute second in good quality, which was uploaded by the user Bro Code 18 January 2021, share the link with friends and acquaintances, this video has already been watched 23,406 times on youtube and it was liked by 1.1 thousand viewers. Enjoy your viewing!