You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: exercises/practice/flower-field/.approaches/introduction.md
+4-3Lines changed: 4 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,8 @@ It is possible to break the exercise down into a series of sub-tasks, with plent
13
13
14
14
Core Python does not support matrices, nor N-dimensional arrays more generally, though these are at the heart of many third-party packages such as NumPy.
15
15
16
-
Thus, the input board and the final result are implemented as lists of strings, though intermediate processing is likely to use lists of lists plus a final `''.join()` for each row in the `return` statement.
16
+
Thus, the input board and the final result are implemented as lists of strings.
17
+
Intermediate processing is likely to use lists of lists, plus a final `''.join()` for each row in the `return` statement.
17
18
18
19
Helpfully, Python can iterate over strings exactly like lists.
19
20
@@ -76,7 +77,7 @@ This can be made to work, but quickly becomes very verbose.
76
77
returnlen([adj for adj in neighbors if adj =='*'])
77
78
```
78
79
79
-
Slightly better, this lists all the possibilities then filters out any that fall outside the board.
80
+
This lists all the possibilities, then filters out any squares that fall outside the board.
80
81
81
82
Note that we only want a _count_ of nearby flowers.
82
83
Their precise _location_ is irrelevant.
@@ -137,7 +138,7 @@ The example below is an object-oriented approach using complex numbers, included
137
138
All validation checks are done in the object constructor.
138
139
139
140
```python
140
-
"""Flower Garden."""
141
+
"""Flower Field."""
141
142
142
143
# The import is only needed for type annotation, so can be considered optional.
0 commit comments