diff options
author | sairam4123 <61322406+sairam4123@users.noreply.github.com> | 2020-04-03 11:52:20 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-03 08:22:20 +0200 |
commit | 3469f0c7fe69e47e80fc2c685b649b70cb2c1f8b (patch) | |
tree | 1a2e694c13d6d43815d01ed8f15a0f0a584dd678 /Demos | |
parent | 2ca3f569254ddee7d1561d102ccca0c9d3250c91 (diff) | |
download | cython-3469f0c7fe69e47e80fc2c685b649b70cb2c1f8b.tar.gz |
Modernise the variable increment in the pyprimes demo script (GH-3486)
Diffstat (limited to 'Demos')
-rw-r--r-- | Demos/pyprimes.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Demos/pyprimes.py b/Demos/pyprimes.py index 7c5242244..5725a8e29 100644 --- a/Demos/pyprimes.py +++ b/Demos/pyprimes.py @@ -5,9 +5,9 @@ def primes(kmax): while k < kmax: i = 0 while i < k and n % p[i] != 0: - i = i + 1 + i += 1 if i == k: p.append(n) - k = k + 1 - n = n + 1 + k += 1 + n += 1 return p |