mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-19 19:03:02 +08:00
contribution guidelines checks (#1787)
* spelling corrections * review * improved documentation, removed redundant variables, added testing * added type hint * camel case to snake case * spelling fix * review * python --> Python # it is a brand name, not a snake * explicit cast to int * spaces in int list * "!= None" to "is not None" * Update comb_sort.py * various spelling corrections in documentation & several variables naming conventions fix * + char in file name * import dependency - bug fix Co-authored-by: John Law <johnlaw.po@gmail.com>
This commit is contained in:
@ -8,7 +8,7 @@ We can see that the 6th prime is 13. What is the Nth prime number?
|
||||
from math import sqrt
|
||||
|
||||
|
||||
def isprime(n):
|
||||
def is_prime(n):
|
||||
if n == 2:
|
||||
return True
|
||||
elif n % 2 == 0:
|
||||
@ -41,11 +41,11 @@ def solution(n):
|
||||
j = 1
|
||||
while i != n and j < 3:
|
||||
j += 1
|
||||
if isprime(j):
|
||||
if is_prime(j):
|
||||
i += 1
|
||||
while i != n:
|
||||
j += 2
|
||||
if isprime(j):
|
||||
if is_prime(j):
|
||||
i += 1
|
||||
return j
|
||||
|
||||
|
Reference in New Issue
Block a user