Skip to content

Commit 9c9521b

Browse files
authored
Update README.md
1 parent 304a8e0 commit 9c9521b

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

exercises/12.1-more_mapping/README.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,24 @@
11
# `12.1` More mapping
22

3-
The list `map()` method calls a function for each value in a list and then outputs a new list with the modified values.
3+
The `map()` method calls a function for each value in a list and then outputs a new list with the modified values.
44

55
```py
6-
#incrementByOne
7-
def values_list(number) {
8-
return number + 1
9-
}
6+
def increment_by_one(number):
7+
return number + 1
108

119
my_list = [1, 2, 3, 4]
12-
result = map(values_list, my_list) #returns [2, 3, 4, 5]
10+
result = map(increment_by_one, my_list) # returns [2, 3, 4, 5]
1311
```
1412

15-
## 📝Instructions:
13+
## 📝 Instructions:
1614

17-
1. Create a function named `increment_by_one` that will multiply each number by 3.
15+
1. Create a function named `multiply_by_three` that will multiply each number by 3.
1816

19-
2. Use the list `map()` function to run the `increment_by_one` function through each value in the list.
17+
2. Use the list `map()` function to run the `multiply_by_three` function through each value in the list.
2018

2119
3. Store the new list in a variable named `new_list` and `print()` the new values.
2220

23-
## 💡 Hint:
21+
## 💡 Hints:
2422

2523
+ The function will take a parameter with the original item being transformed and added into the new list.
2624

0 commit comments

Comments
 (0)