File tree Expand file tree Collapse file tree 1 file changed +7
-13
lines changed
Expand file tree Collapse file tree 1 file changed +7
-13
lines changed Original file line number Diff line number Diff line change 11# ` 12 ` Map a list
22
3- ``` py
4- Python map ()
5- ```
6-
7- The ` map() ` function applies a given function to each item of an iterable (list, tuple etc.) and returns a list of the results.
3+ The ` map() ` function applies a given function to each item of an "iterable" (list, tuple, etc.) and returns a list of the results.
84
95### The syntax of map() is:
106
117``` py
128map (function, iterable, ... )
139```
14- #### map() Parameter:
10+
11+ #### map() Parameters:
1512
1613** function:** passes each item of the iterable to this function.
1714
1815** iterable:** iterable which is to be mapped. You can pass more than one iterable to the ` map() ` function.
1916
2017#### Return Value from map():
2118
22- The ` map() ` function applies to a given function and in particular to each item of an iterable and returns a list of the results.
19+ The ` map() ` function applies to a given function and, in particular, to each item of an iterable to return a list of the results.
2320
24- The returned value from ` map() ` (map object) then can be passed to functions
25- like list() (to create a list), set() (to create a set) and so on.
21+ The returned value from ` map() ` (map object) then can be passed to functions like ` list() ` (to create a list), ` set() ` (to create a set) and so on.
2622
27- ## 📝Instructions:
23+ ## 📝 Instructions:
2824
29251 . Using the same logic, add the needed code to convert a list of Celsius values into Fahrenheit inside the ` map() ` function.
3026
31- ## Expected result:
27+ ## 💻 Expected result:
3228
3329``` py
34- Expected in console:
35-
3630[28.4 , 93.2 , 132.8 , 14.0 ]
3731```
You can’t perform that action at this time.
0 commit comments