Your First Python Program
Now, it's time for you to write your first program.
Writing the Program
To write our very first program, we will be using our freshly installed Sublime Text. First, open up Sublime Text, and you should the following screen:
Inside of it, write:
print("Hello World!")
Running the Program
Now, we need to save our Python program. To do this, press the Ctrl and S keys. You should see a window like the following pop up:
Navigate to the folder you want your program to be in and enter a name for the text. It's important that the file ends in ".py". I'm calling mine helloworld.py.
To run the program, press the Ctrl and B keys and choose "Python". You should see Hello World! printed at the bottom.
Code Breakdown
Time for a breakdown of what we just did. Below is the code:
print("Hello World!")
The print
tells Python that we want to print something. The brackets tell Python that it's a function. You'll learn more about functions in a later tutorial. Finally, the quotes tell Python that there will be some text. In the program, we used double quotes, but could've just as easily used single quotes.