Skip to content

Commit

Permalink
fix: rename variables for get_primes_in_range
Browse files Browse the repository at this point in the history
  • Loading branch information
rzmk committed Oct 11, 2023
1 parent 466af4c commit 8c2cb91
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions notebooks/pre-algebra/unit1.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -284,11 +284,11 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"**Write a program that finds all prime numbers of a positive integer `n` in the range `[n, end]`.**\n",
"**Write a program that finds all prime numbers of a positive integer `n` in the range `[start, n]`.**\n",
"\n",
"- Assume that `n` and `end` are positive integers greater than or equal to 1.\n",
"- Assume that `start` and `n` are positive integers greater than or equal to 1.\n",
"\n",
"For example for `n = 1` and `end = 20`, the output of `get_primes_in_range(1, 20)` may be:\n",
"For example for `start = 1` and `n = 20`, the output of `get_primes_in_range(1, 20)` may be:\n",
"\n",
"```\n",
"{2, 3, 5, 7, 11, 13, 17, 19}\n",
Expand All @@ -301,9 +301,9 @@
"metadata": {},
"outputs": [],
"source": [
"def get_primes_in_range(n: int, end: int) -> set:\n",
"def get_primes_in_range(start: int, n: int) -> set:\n",
" primes: set = set()\n",
" for num in range(n, end + 1):\n",
" for num in range(start, n + 1):\n",
" if is_prime(num):\n",
" primes.add(num)\n",
" return primes\n",
Expand Down

0 comments on commit 8c2cb91

Please sign in to comment.