filmov
tv
Python one-liner map to repeatedly call a function 🤩 #python #pythoncoding #coding #shorts
Показать описание
Calling the same method with different arguments generally requires a loop. Python has a cool technique precisely for this using the map function. You can call your function for each item in an iterable using the map function. The video shows how to do it.
The map function creates a map object. depending on the Python environment you are using, it might not call your method yet. If you try to convert the result to a list, then the map object will run the Runnur method with each of the items in x.
This is pretty amazing 🤩
---------
Objects like lists, tuples, sets, and dictionaries are some examples of iterables.
Dr. Shahriar Hossain and Dr. Monika Akbar
The map function creates a map object. depending on the Python environment you are using, it might not call your method yet. If you try to convert the result to a list, then the map object will run the Runnur method with each of the items in x.
This is pretty amazing 🤩
---------
Objects like lists, tuples, sets, and dictionaries are some examples of iterables.
Dr. Shahriar Hossain and Dr. Monika Akbar