skip to Main Content

enter image description here

why is this error there in the terminal?

i was trying to run a simple file after saving it yet it wasnt able to locate the file in the directory as mentioned, hence was giving the following error.

2

Answers


  1. The simplest way to fix this is to remove : at the end of second line. It is a typo which kind of destroys rest of the code.

    Login or Signup to reply.
  2. Delete your current terminal, or Ctrl+Z and press Enter to exit the current python interactive mode.

    When your terminal looks like this you can use the play button to run the code.

    enter image description here

    When your terminal looks like this, it means that you have opened the python interactive terminal, where you can directly type the code and run it, but you cannot run the command.

    enter image description here

    By the way, as others have said there is a bug in your code, you need to remove the semicolon at the end of the second line.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search