Python Mastery Course (Type Conversion) Part 1

HELP. I am stuck in the type conversion lesson of The Python Mastery course, which I suspect may have something to do with Code Runner or how I am using Terminal. Please look at the embedded screenshot and advise. I am trying to recreate the error as shown in the video screenshot of the lesson. First of all, i was not allowed to enter a value from the terminal (something about read only). Secondly, when I run the code using the $python app.py on mac, it tells me that the code is already running. I also don’t understand why I have to see the long path harlanreece@Harlans-MacBook-Air PythonDemo % in my terminal window, when all I see in Mosh’s terminal window (from video) is Hello World. I have been viewing the results of code output from the output tab in the terminal, which has been working fine. My questions are: Why can’t I recreate the error and did I make a configuration error when I set up Python to run in VS Code and why is long path showing up my terminal window?


I am extremely frustrated as this seems like an important aspect of learning Python. I will submit an additional post with the same question, but different image due to the media posting liimitation.

The input() function returns String. So your first line evaluated to “1” which is String. At line two you are trying to add String “1” to int 1 which is impossible. What you have missed is the int() function. just change the line one as bellow:
x = int(input("x: "))
This way you take the input from user and convert it to int on the fly.