1

INTRODUCTION TO PYTHON

by

The Education Machine

[support@theeducationmachine.com]

Below are the topics covered in this tutorial:

  1. What is Python?
  2. Why Python?
  3. Is python Interpreted or compiled?
  4. What is REPL
  5. Python IDEs
  6. Python Installation
  7. How to use Jupyter Notebook

Before we start learning python, we should know what is the symbol or logo of Python programming language.

If something like below is coming into your mind, then you many delete this picture from your memory :)

Below is the actual logo of python progamming language:

What is Python?


Python is a high level, interpreted scripting Language.

Python is easy to learn language but still powerful because of its efficient high level data structures and adoptation of OOP(Object-Oriented Programming).

Python is a High level language.

-- What is a High Level Language????

-- What other High level languages do we have?

High level Languages are those which can accept plain English text and converts them to machine level language(i.e. in bytes - 100101) using compiler.

Other High level Languages: Java, Ruby, PHP, etc.

Why Python?


1.) Python has more than 20% stake in market as compared to other languages

2.) Free and Open Source Software(FOSS)

3.) It can be install on any operating system(windows/mac/linux)

4.) Portable

5.) Huge community support on various channels

Is python Interpreted or compiled?


Python can be said as Interpreted Language but truly it is "COMPILED & INTERPRETED",

wait!!

What does it mean, how can a language be both compiled and interpreted?

1.) When a python program is executed, compiler first compiles the code and converts into machine language, i.e. in bytes

2.) After bytes convertion, it is interpreted line by line in PVM(Python Virtual Machine).

------------DO NOT CONFUSE YOURSELF WITH A VIRTUAL MACHINE LIKE "VMWARE"------------

What is REPL?


Let us understand how Python Terminal works

The most straight forward way to start talking to Python is interactive REPL REPL -> Read--Evaluate--Print--Loop

Using terminal, user can directly give commands to the interpreter

Session in the terminal stays active until a user instructs the interpreter to terminate

Python IDEs


IDE stands for Integrated Development Environment.

A software/tool/platform which can offer functionalities to perform coding and development.

Using an IDE, user gets better user interface as compared to Terminal. User can view various objects, they get multiple settings to enhance the look and feel for coding.

In this python series of sessions, we will work on Jupyter Notebook and Spyder according to the requirement.

Jupyter Notebook creates .ipynb files by default

Spyder creates .py files which is the actual extention for python codes

Python Installation

We will look at installation of python from python.org and using Anaconda

To launch Jupyter directly from a specific location of your desktop, you need to

  1. install python from python.org
  2. open command prompt
  3. run 'pip install jupyter'

How to use Jupyter Notebook

We will see demo of various options in Jupyter