primr py

Solutions on MaxInterview for primr py by the best coders in the world

showing results for - "primr py"
María
18 Mar 2016
1def isPrime(n) :
2if (n <= 1) :
3return False
4if (n <= 3) :
5return True
6if (n % 2 == 0 or n % 3 == 0) :
7return False
8i = 5
9while(i * i <= n) :
10if (n % i == 0 or n % (i + 2) == 0) :
11return False
12i = i + 6
13return True
14if (isPrime(11)) :
15print(" true")
16else :
17print(" false")
18if(isPrime(15)) :
19print(" true")
20else :
21print(" false")
22
similar questions
queries leading to this page
primr py