|
1327 | 1327 | " Given a list of integers, write a function that only keeps the numbers that are multiples of a given constant <code>k</code>.\n", |
1328 | 1328 | " <ul>\n", |
1329 | 1329 | " <li>\n", |
1330 | | - " <strong>Example 1</strong>: given <code>nums = [1, 2, 3, 4, 5]</code>, and <code>k = 2</code>, the result must be <code>[2, 4]</code>\n", |
| 1330 | + " <strong>Example 1</strong>: given <code>my_list = [1, 2, 3, 4, 5]</code>, and <code>k = 2</code>, the result must be <code>[2, 4]</code>\n", |
1331 | 1331 | " </li>\n", |
1332 | 1332 | " <li>\n", |
1333 | | - " <strong>Example 2</strong>: given <code>nums = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]</code> and <code>k = 5</code>, the result is <code>[5, 10]</code>\n", |
| 1333 | + " <strong>Example 2</strong>: given <code>my_list = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]</code> and <code>k = 5</code>, the result is <code>[5, 10]</code>\n", |
1334 | 1334 | " </li>\n", |
1335 | 1335 | " </ul>\n", |
1336 | 1336 | "</div>\n", |
|
1359 | 1359 | "source": [ |
1360 | 1360 | "%%ipytest\n", |
1361 | 1361 | "\n", |
1362 | | - "def solution_multiples_of_n(my_list: \"list[int]\", k: int) -> \"list[int]\":\n", |
| 1362 | + "def solution_multiples_of_n(my_list: list[int], k: int) -> list[int]:\n", |
1363 | 1363 | " \"\"\"A function that keeps only the multiples of k from a given list.\n", |
1364 | 1364 | "\n", |
1365 | 1365 | " Args:\n", |
|
1704 | 1704 | "\n", |
1705 | 1705 | "def solution_exercise3(words: list[str]) -> list[(str, int)]:\n", |
1706 | 1706 | " \"\"\"A function that counts the number of words from a given list that start with each letter of the alphabet, using sorted() and itertools.groupby.\n", |
1707 | | - " The function should be case insensitive, using lower() to ensure consistet capitalization.\n", |
| 1707 | + " The function should be case insensitive, using lower() to ensure consistent capitalization.\n", |
1708 | 1708 | " It should return a list of tuples, where each tuple contains a letter and the number of words that start with that letter.\n", |
1709 | 1709 | " The list of tuples should be sorted in alphabetical order.\n", |
1710 | 1710 | "\n", |
|
0 commit comments