You are viewing a single comment's thread. Return to all comments →
Python 3
import math t = int(input()) def isPrime(n): if n==1: return 'Not prime' for i in range(2,int(math.sqrt(n))+1): if n%i==0: return 'Not prime' return 'Prime' for i in range(t): n = int(input()) print(isPrime(n))
Seems like cookies are disabled on this browser, please enable them to open this website
Day 25: Running Time and Complexity
You are viewing a single comment's thread. Return to all comments →
Python 3