Program to check the Perfect Number or Not

num=input("Enter the number:")
i=1
while i<=num/2:
 s=i**2
 if s==num:
  print "perfect square"
  break
 i+=1
else:
 print "Not a perfect square"

No comments: