Skip to content

Commit 27af14b

Browse files
authored
Merge pull request yidao620c#126 from lambdaplus/patch-4
fix indent error
2 parents a7861d0 + 5739107 commit 27af14b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

source/c01/p18_map_names_to_sequence_elements.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@
5252
.. code-block:: python
5353
5454
def compute_cost(records):
55-
total = 0.0
56-
for rec in records:
57-
total += rec[1] * rec[2]
58-
return total
55+
total = 0.0
56+
for rec in records:
57+
total += rec[1] * rec[2]
58+
return total
5959
6060
下标操作通常会让代码表意不清晰,并且非常依赖记录的结构。
6161
下面是使用命名元组的版本:

0 commit comments

Comments
 (0)