# Introduction

#### NOTE: This tutorial assumes that you know *something* about programming.

## What is Python?

![Image Source: python.org](https://2737163004-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LSruiKRiUukuN2fDjTT%2F-LSsERirIHInMz0V9iXH%2F-LSsGiMV7ef-7xpCFchx%2Fpython%20logo.png?alt=media\&token=3d4410a2-3997-4efe-9644-3d7fa3edd2c9)

Python is a programming language. It lets you make desktop applications, web applications, bots, web crawlers and even Artificial Intelligence! With the right equipment, you can create robots, drones etc.

{% hint style="info" %}
Fun fact: Python was created by Guido Van Rossum.
{% endhint %}

## Anything else I should know before starting?

Python has two major versions: Python 2 and Python 3.

Python 3 is the "future" of Python. It's a significant improvement from Python 2. Python 3 code is guaranteed to work in *all* future versions. It's more elegant and readable than Python 2 as well. Python 2 is going to be deprecated (stop being supported) in 2020, so that means it will no longer get any more bug fixes. I highly recommend learning Python 3.

## Great! How do I get started?

To start making cool stuff with Python, you need to install it.

&#x20;Now, if you're just a beginner who wants to learn Python, you can either choose Python 3.6 or Python 3.7. Since Python 3.7 just came out, a few libraries such as Tensorflow (a package you use for Machine Learning or AI) don't quite support it yet. While there's no problem in using Python 3.7, for better compatibility with libraries you should get Python 3.6.\\

## Installation on Windows

Windows does not have Python installed by default. Head over to <https://www.python.org/downloads/>, scroll down to "Looking for a specific release?" and select the latest version of Python 3.6. You will be redirected to a new page where you have to scroll down to "Files" and select the suitable package for you. If you're unsure which one to select, click on **Windows x86-64 executable installer.** it should start downloading a `.exe` file. After it's done downloading, start the installing wizard and follow the steps. Make sure to check the box named "Add Python 3.6 to PATH" before starting.

## Installation on Mac

Mac has Python 2 installed by default. But you will not be able to follow this tutorial with Python 2, so you should get Python 3. To install Python on Mac, you have two options.\
\
Go to <https://www.python.org/downloads/>, scroll down to "Looking for a specific release?" and select the latest version of Python 3.6. You'll be redirected to another page where you scroll down to "Files" and click on "macOS 64-bit Installer" or "macOS 64/32-bit Installer" depending on your machine's architecture. After it's finished downloading, fire up the installer and follow the instructions.\\

Or, if you have Homebrew installed, you can just `brew install python`

## Installation on Linux

If you're on Linux, then you should already have Python 3 installed. But, just in case, open the Terminal and run `python3 -V` if the output starts with 3.6, you're good to go. If it starts with 3.5, that's fine too.

If you do not have Python 3 installed, then follow the instructions below for your distribution.

Ubuntu: `sudo apt install python3.6`

Fedora: `sudo yum install python3.6`

Arch Linux: `pacman -S python`

For others, you can either look it up with Google or build from source.

## Installation on Mobile

Android: Install the PyDroid 3 app from Play Store.

iOS: Install the Pythonista app from App Store.

## Done. Now what?

Now, you need to open the python "prompt" or "console". This is a place where you can run a line of python code at a time. On windows, open `cmd.exe` , on Mac and Linux open the `Terminal` and on mobile open the app you installed for your platform.\
\
Now, on windows just enter `python` and on Mac and Linux enter `python3` .\
You've successfully entered the Python prompt!

## Your first program

Alright. You've successfully installed and opened python. Now, get a paper notebook and a pen and jot down the date and time, for this is when you created your very first program! In the Python prompt, you should see a `>>>` .

{% code title="python" %}

```
>>> print('Hello World')
Hello World
```

{% endcode %}

&#x20;This is called a prompt. Now, the very first program most beginners create is called the "Hello, World!" program. enter this line of code:\
`print('Hello World')` in the prompt and press enter. You should see a nice little "Hello World" appearing on the next line.\
**Congrats, you've created your first program!**

## That's it?

Yes. Python really is that simple. In the next tutorial you will set up a development environment and learn some of the basics of Python including the `print` function.\
\\

## Homework

Yes, I'll give you homework. Since practice is the only way you can learn to be a successful programmer. Your homework will be trying to produce different outputs with `print` . Try adding more text.

## Contact

If you're stuck, feel free to email me at <memoryerror@yandex.com> or if you have a discord account join my server at <https://discord.gg/6Au9jQy> where you can ask for help from anyone.
