@@ -58,7 +58,8 @@ You have an extra item you need to take into account:
5858 costs = [8, 5, 20, 12, 1]
5959 extra = 4
6060
61- Modify the code from exercise 1 to include the extra item in the sum.
61+ Use a list method from exercise 2 to add the extra item to the list.
62+ Then calculate the sum.
6263
6364
6465Exercise 4: Concatenate
@@ -79,24 +80,8 @@ Explain the difference between the following expressions:
7980 "[1, 2" + "3, 4]"
8081
8182
82- Exercise 5: Conversion
83- ----------------------
8483
85- Often, you need to modify list items while processing them.
86- Consider the following code:
87-
88- .. code :: python3
89-
90- costs = ["8", "5", "20", "12", "1"]
91- total = 0
92- for item in costs:
93- ___
94- print(total)
95-
96- What do you need to insert in the gap so that the sum gets calculated?
97-
98-
99- Exercise 6: Puzzle
84+ Exercise 5: Puzzle
10085------------------
10186
10287Use the expressions to modify the list as indicated. Use each expression
10691 :alt: list funcs exercise2
10792
10893
109- Exercise 7 : List transformation
94+ Exercise 6 : List transformation
11095-------------------------------
11196
11297Sometimes it is useful to create a new list from an existing one.
@@ -123,7 +108,7 @@ Order the lines in the following program:
123108 numbers = []
124109
125110
126- Exercise 8 : Receipt assistant
111+ Exercise 7 : Receipt assistant
127112-----------------------------
128113
129114Write a program that sums up shopping bills.
0 commit comments