-4

I am working on this code.

Number=int(input("Enter:  ")
for x in Number:
    if Number is x*x:
        print("It's a perfect square!")
    else:
        print("It's not a perfect square")

I got an invalid syntax error on the colons and the print when I run the code.Can somebody tell me what's wrong with it?

DYZ
  • 55,249
  • 10
  • 64
  • 93
FD7
  • 3
  • 1
  • 4
    You need to read a tutorial like the [official Python tutorial](https://docs.python.org/3.6/tutorial/index.html) because you are making mistakes in several fundamental areas. – TigerhawkT3 Jan 17 '17 at 05:56
  • 1
    I'm voting to close this question as off-topic because SO is not a tutorial service. – TigerhawkT3 Jan 17 '17 at 05:56
  • In order to check whether number is a perfect square, you may check: [How could I check if a number is a perfect square?](http://stackoverflow.com/questions/2489435/how-could-i-check-if-a-number-is-a-perfect-square) – Moinuddin Quadri Jan 17 '17 at 06:48

1 Answers1

-1

First reason for your error is "Close brace missing in First Line.". even if you correct this, there is a logical error in your code.

Siva S
  • 752
  • 6
  • 12
  • Your post boils down to "there is a typo" (which is best solved in a comment, as such questions are not on-topic for this site), with a note that this answer is missing other useful information. This isn't useful. – TigerhawkT3 Jan 17 '17 at 06:39