Python Tutorials for Beginners - Part 1: Setting Up Your Work Environment and Writing Your First Program
We will start off by setting up the environment we need to use in order for us to write and run our Python scripts, then we will write a simple program to test that our environment is good to go.
Part 1 - Setting up the Environment:
1 - Download Python: download python from Download Python | Python.org
2 - Download Visual Studio Code
3 - Launch Visual Studio Code --> Click on File --> Preference --> Extensions.
- From there search for Python and see if you have the extensions installed.
- In the screenshot below, you can see how it looks like when it is already installed.
- Install the Python extensions if you don't have them installed already.
Part 2 - Writing our First Program:
Alright... click on File --> New File --> select the Python option as shown in the screenshot below.
We will write a program that says: "What's up, fam!"... just to change things up from the usual Hello World starting programs a lot of tutorials have you doing.
- We will start off by creating a variable called greeting so we can store the string What's up, fam!.
- From there, we will use the print statement to print out the greeting.
Our code will look something like this:
greeting = "What's up, fam!"
print(greeting)
NOTE: Python is sensitive to indentation, so make sure statement are not indented. (You will see later on when you need to indent).
After doing so, click on the Run Python File icon
At the bottom of Visual Studio Code, you will see the output of your program.
Congratulations! you have just finished writing your first Python program :)