|
47 | 47 | "metadata": {},
|
48 | 48 | "source": [
|
49 | 49 | "### Solution Explanation\n",
|
50 | | - "> **Step 1**: Iterate from `start` (= 2000) to `stop` (= 3200). To include 3200, use `3200 + 1` as the `stop`\n", |
51 | | - ">\n", |
52 | | - "> **Step 2**: Filter out numbers (`x`) which are multiple of 7 (i.e. `x % 7` => 0) and which are not multiple of 5 (i.e. `x % 5` != 0)\n", |
53 | | - ">\n", |
54 | | - "> **Step 3**: To do this in **Pythonic** way, combine the 2 steps to form a **List Comprehension**\n", |
55 | | - ">\n", |
56 | | - "> **Step 4**: To print it as comma separated list, use `str.join()` method to concatenate list elements to form a string.\n", |
57 | | - ">\n", |
58 | | - "> **Step 5** (A Catch): `join` accepts iterable of string, hence call `str()` on the list element in the comprehension." |
| 50 | + "> **Step 1**: Iterate from `start` (= 2000) to `stop` (= 3200). To include 3200, use `3200 + 1` as the `stop` \n", |
| 51 | + "> **Step 2**: Filter out numbers (`x`) which are multiple of 7 (i.e. `x % 7` => 0) and which are not multiple of 5 (i.e. `x % 5` != 0) \n", |
| 52 | + "> **Step 3**: To do this in **Pythonic** way, combine the 2 steps to form a **List Comprehension** \n", |
| 53 | + "> **Step 4**: To print it as comma separated list, use `str.join()` method to concatenate list elements to form a string. \n", |
| 54 | + "> **Step 5** (A Catch): `join` accepts iterable of string, hence call `str()` on the list element in the comprehension. " |
59 | 55 | ]
|
60 | 56 | },
|
61 | 57 | {
|
|
0 commit comments