Getting Started With Python
Tags: python, beginners, programming, tutorial
Published: 2022-02-19 10:05:54

## Introduction to Python
> Python is a simple, well-structured, easy-to-read syntax interpreted high-level programming language.

**Programming Language:-** A human readable language used to give instructions to computers, written in various ways and compiled by using a compiler and then converted to machine-understandable language to process the desired work.

There are many programming languages in the world. But among all of them Python is the most popular programming language.

---
## History of Python
> **The programming language Python was conceived in the late 1980s, and its implementation was started in December 1989 by Guido van Rossum at CWI in the Netherlands as a successor to ABC capable of exception handling and interfacing with the Amoeba operating system.** Van Rossum is Python's principal author, and his continuing central role in deciding the direction of Python is reflected in the title given to him by the Python community, Benevolent Dictator for Life (BDFL). (However, van Rossum stepped down as leader on July 12, 2018.). 
**Python was named after the BBC TV show Monty Python's Flying Circus.**

![Guido_van_Rossum_OSCON_2006_cropped(Father of Python).png](https://cdn.hashnode.com/res/hashnode/image/upload/v1646024963409/22EcLGeMO.png)
**Picture -> Monte van Rossum**

***Source -> Wikipedia***

---
## Why Python?
- Easy to Read and Debug
- Helps to write Clean Code
- Easy Syntax
- Many things can be done by writing fewer lines of code, whereas, in other language you have to write more lines of code to do the same task.

---
## Where Python is used?
It is used in the following cases - 
- Making Games
- Making Web Apps
- Artificial Intelligence
- Data Science, and many more.

---
## Setting Up Python In Your Computer
You can download python from [here](https://www.python.org/downloads/).
Then install it as you install a software on your computer.

---
### Python Current Versions
Every day technology is evolving and software and programming languages are also upgrading everyday and new versions are coming up. 
Basically, Python has two versions now - Python2 and Python3. 
If you've already installed python on your computer and you're using Python2, then I would recommend you to upgrade it to Python3.

---
### Checking your Current version of Python
1. Type `cmd` in your search box of Windows.
2. Open Command Prompt
3. Type the following command and hit Enter.
```cmd
python --version
```
You will see something like this - 
![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1645253618454/wPuOsOFS1.png)

---
## Checking Python In Terminal After Installation 
After you've installed Python on your system, now you have to check whether it is perfectly working on your system or not. 

**Follow these steps:-** 
1. Open your terminal(Command Prompt)
2. Type `python` and hit Enter.   
It will come up like this - 
![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1645254128173/CoA7T9Jo6j.png)
3. Type the following and hit Enter. 
```python
print("Hello World")
```
4. The output should appear like this - 
![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1645254276143/FJbXqxLed.png)
5. Now, this proves that Python is working perfectly on your system.
6. Now type `exit()` and hit Enter and then close the terminal.

**Congratulations. 🎉 You have done your first Python program via the terminal.** 😃

---
## Use of Python files
It's not always a good practice to write your code in the terminal and run it to get the output. Also, it doesn't save your in the terminal. So, we all create a Python file to save our code on our machine and we use a code editor or IDE to compile our Python file having the source code and get the output.

You can use any code editor or IDE you like based on your requirements. You can use PyCharm. I personally love to use Visual Studio Code and it's beginner friendly too. 

---
## Some IDE's and Code Editors for Python
- [Visual Studio Code](https://code.visualstudio.com/Download). -> [Code Editor]
- [PyCharm](https://www.jetbrains.com/pycharm/download/#section=windows). -> [IDE]
- [Sublime Text](https://www.sublimetext.com/download). -> [Code Editor]
- [Atom](https://atom.io/). -> [Code Editor]
- [Jupyter Notebook](https://jupyter.org/install)
- [GNU Emacs](https://www.gnu.org/software/emacs/). -> [Code Editor]

---
## Setting Up Visual Studio Code for Python
1. Download and install Visual Studio Code from the link given above. It's free of cost.
2. Open it and then go to the Extension Tab. 
![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1645256199891/0iwee2APN.png)
3. Type **python** in the search bar and click on the first one powered by **Microsoft**.
4. Install it and reload the VS code after installing the extension. 
![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1645256319953/rEV4e7mSS.png)
Since, I've already installed, it's showing it me the two buttons Disable and Uninstall. But when you'll install it for the first time, there will only one single **Install button** there for you. After installation, it should show like the above image. 

👀 Note that, it's an extension so no options like Next Next buttons in a dialog box will appear before you. It will get install automatically as you click on the **Install** button. 

---
## Writing Program in Visual Studio Code
1. Create a python file in the sidebar with `add.py` and hit enter.
2. Select the interpreter for Python by using the shortcut `Ctrl+Shift+P`.  
![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1645256963496/rm9CiV0a7.png)
3. Write the following code in your file.
```python
a = 5
b = 7
sum = a + b
print(sum) 
```
4. Save your file and run it using the Run Code button located on the top right corner of VS Code.
5. The output should come like this:-  
![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1645257674119/3XRIfCGij.png)

**Congratulations. 🎉 You have learnt how to add two numbers and print the value.** 😃

---
### Explaining the Code 
```python
a = 5
b = 7
s = a + b
print(sum)
```
Here, a, b and s are **variables**. We have assigned a value 5 to a and 7 to b. Then we have added the two numbers 5 and 7 and stored it into s variable. Then we're printing the value of sum of two variables a and b. Here, print() is an in-built function used to print any values or names as Output.

For now, you understand it as like you have 3 bowls with you and the first 2 bowls contain some items in it and we're mixing the items together in the 3rd bowl and displaying the mixture.   
We'll cover variables and data types and all other things in detail in our upcoming articles.

---
### You can also watch this [video](https://youtu.be/j6IPc0vXxQA) for clarity.

---
## Hope this helps you. Thank you for reading, and let's connect!
Thank you for reading my blog. Feel free to subscribe to my [YouTube Channel](https://www.youtube.com/channel/UCsuzc8lqAbgUYo4yzpjtfSw) and connect on [LinkedIn](https://www.linkedin.com/in/susmita-dey-15a15a210/) or [Twitter](https://twitter.com/its_SusmitaDey).
Also, feel free to [support](https://www.buymeacoffee.com/susmitadey) my work.😊