The First Line Of Code

Once you have you have python downloaded it’s time to write your first line. (If you don’t have python refer to the previous article.) First, we have to open python, I am using Pycharm but if you are using a different software that will work just fine.

Once you open up PyCharm you will have to answer a few questions and agree to the terms and once you have done that you’ll arrive at a screen that says things like Search everywhere and project view. We won’t click on any of those rather press on file at the extreme top left-hand corner. From there click on New Project, and then Create, this may take a little time but don’t worry that’s normal. Once you have arrived at the screen below click on the minus sign to get the coding portion in full screen.

Now in order to delete all of the given code press Ctrl A and then backspace. Once you have a clean slate its time to start coding. We are going to start off by getting hello world as a response from your code. In order to do this we will have to first print the statement so we are just going to type print. Now in order to tell the computer what we want to print we will have to put it in brackets. So just do shift 9 and you will have two brackets, next we will have to put double quotations for the computer to understand we want to print this statement. Once we have put double quotations inside of the parentheses, type whatever you would like.

Now all we have to do is run the code and we are good to go. So all you have to do is click Run on the top of the page you are on and click run main, or whatever your code is called. In order to rename your code all you have to do is right click on and click rename, just MAKE SURE to add .py to end of your name because it is a python file.

There you go you have written your first line of code! CONGRATS!!

Leave a Reply

Your email address will not be published. Required fields are marked *