Computer Science, asked by eelizajaved7250, 1 year ago

def f(n): s=0 for i in range(1,n+1): if n%i == 0: s = s+1 return(s%2 == 1) The function f(n) given above returns True for a positive number n if and only if:​

Answers

Answered by King9maker
1

Answer:

fyhufgh

Explanation:

Answered by AskewTronics
0

"n is a perfect square" is the correct answer for the above question

Explanation:

  • The above question code is in python language If the input given by the user is a perfect square, then the output is "true" otherwise "false" is returned by the function "f".
  • It is because the above function "f" firstly counts the number of factors for any number.
  • Then it checks that the total factor is a (multiple of 2)+1 or not, if it is (multiple of 2)+1, then it will be definitely a perfect square of any number.
  • So it returns true if the factor of any number is (multiple of 2)+1 otherwise it returns false.

Learn More:

  • Python : https://brainly.in/question/14689905
Similar questions