0

that's my first post here and most definetely a really simple but I definetely could not find the answer while Googling for it.

I have just started studyign Python, and during the first few exercises the instructor (online) has been only using the editor console to give examples of the subject.

This error only happens when on Sublime Text editor and doesn't even give me the chance to right the next command, if I use for example the Python IDLE this does not happens.

In Sublime

>>> if (5 > 3): 
File "<string>", line 1
    if (5 > 3):
              ^
SyntaxError: unexpected EOF while parsing
>>> if 5 > 3:
  File "<string>", line 1
    if 5 > 3:
            ^
SyntaxError: unexpected EOF while parsing

In Python IDLE

>>> if 5>3:
    print("Hello")


Hello

I believe it should be something ridiculous but I really could not find an answer for it yet. I could just skip that and continue with the course but wondering if might come up again and I'll still have to fix it so better do it now.

Appreciate any help.

Thanks.

FS

  • Is that the last line of your file? – AMC Dec 19 '19 at 15:11
  • @AMC those are the only lines, the instructors is just showing examples directly in the console. He's using PyCharm but I am more familiar with Sublime.. I wonder if it could be a text editor related issue – F Santos Dec 19 '19 at 15:17
  • Try adding a `pass` statement as the body of that if statement! – AMC Dec 19 '19 at 16:02

0 Answers0