+ 2
What will be the answer for this ? I need it with explanation
def h(n): f = 0 for i in range(1,n+1): if n%i == 0: f = f + 1 return(f%2 == 1) 1.n is a multiple of 2 2.n is a composite number 3.n is a prime number 4.n is a perfect square
1 Answer
def h(n): f = 0 for i in range(1,n+1): if n%i == 0: f = f + 1 return(f%2 == 1) 1.n is a multiple of 2 2.n is a composite number 3.n is a prime number 4.n is a perfect square