DEV Community

Cover image for Python 101: Ultimate Python Guide
Elphas
Elphas

Posted on

Python 101: Ultimate Python Guide

__

Introduction

Python is a high level programming language that was developed by Guido van Rossum.
It is also referred to as general purpose programming language due to its wide range of applications such as:

  • Data Analytics

  • Web Development

  • Machine Learning & AI

  • Wed Data Scraping

  • Data Science

  • Desktop Applications

Setting Up Python

Python comes with 2 main distributions ;

  • Python Software Foundation (PSF)

  • Anaconda Distribution

In this article, we'll only focus on the PSF.

Install Python

Python installation for Windows does not need much othee than downloading the Python installer from python.org.

Step 1: Downlaod the installer

Open your favorite browser window and navigate to the python download page for Windows.
Click on the link for the latest Python 3 Release. O went with Python 3.9.6 which is the most stable 3.9.x version for demonstration purposes.

Step 2: Run the installer

Double-click on the downloaded .exe file and you should see the following window pop up;

Python installer window
Important: Make sure to check the box that says add python 3 x to path to ensure that the install places the interpretor into your execution path.
Click on Install now to install Python 3 and wait for the installation to finish.

First python program

Now that we are done with python 3 installation, it's time time to write our first program.
There are numerous IDE's and text editors to write Python code but in this tutorial we'll use Python's built'in IDLE.
To open IDLE, type the following command in youe command prompt.
$ idle-python3.9
IDLE opens a Python shell in a new window.
The Python shell is an interactive environment that allows you to write python code and execute it imediately.
This is we write our "Hello, world" program.
To print out something in Python, we use the print() function.
Type the code below in your interactive python shell.
print("Hello, World")

Running our first code

Before running our code, we need to save it. Click on File then Save As and save your code as "hello.py".
Notice the .py extension; that tells our intepretor that it is running a python code.
After saving your code, click f5 to run.
If all went well, the following window should appear;
Hello world

Conclusion

This was a tutorial on getting started with Python programming. We have gone through the installation provess and written our hello, world program.
But there is more to Python programming than that.
In the next article, we'll be looking at Strings and Methods.
Thanks for reading.

Top comments (0)