1. What is Python?
Let’s start with the basics. Python is a high level, interpreted programming language. Let’s explain what this means.
A high-level programming language is closer to how people would communicate, making it easier to read, write and understand. In other words, complicated issues like how the computer allocates memory for each task is handled behind the scenes, meaning you don’t have to do it yourself.
An interpreted language is a language where the code you write is not directly converted into machine code(the language the computer understands). Instead, there is another program(called an interpreter) that reads your code line by line. Imagine giving someone instruction to the shop:
Mary: Walk straight.
The person walks straight.
Mary: Turn Left
The person turns left
Mary. Stop there.
They stop.
Each instruction is processed immediately. This is how interpreted languages work – they don’t plan the entire journey in advance; they handle it step by step.
Python is used everywhere: from building websites, apps, automation, data analysis, artificial intelligence… you name it. It is what they call the Swiss Army knife of coding!
2. Why use Python?
Here is why Python is a great choice.
- It’s Easy to Learn
- It’s Versatile – You can use Python for almost anything. From automating mundane tasks to building powerful systems, Python can do it all.
- It’s Popular – Since Python is loved by developers worldwide, there are tons of resources, tutorials, and communities to help you. You’ll never feel lost.
3. Getting Started with Python.
Before we dive into writing Python code, here is what we will need.
Step 1: Download and Install Python
- Visit the official Python website https://www.python.org/
- Navigate to the “Downloads” section. Then click on Download Python.
- After the download is complete, run the downloaded installer.
- Check the box “Add Python to PATH“
- Select Install Now and Follow the prompts.
- After installation is complete, open the start menu, and open the command prompt.
- In the command prompt, type in the following command,
python --version
- If Python is installed, the version number will be displayed.
Step 2: Download and Install pip (Python Package Manager)
pip is typically installed with Python during installation. To check:
In the command prompt run
pip --version
If pip is not installed, follow the following steps:
In the command prompt, run the code below to download the get-pip.py
script.
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
Then followed by:
python get-pip.py
Check the pip version using
pip --version