Basic Python

PYTHON,
INFOX IT TRAINING,

A little bit history of Python:
Python was conceived in the late 1980s by Guido Van Rossum and was first released in 1991. Even though it came out earlier than Java(which was introduced in 1995) but it didn’t get much popularity until late the 2000s. In late 2000s Google started using Python heavily and started reinvesting on language and since then it has been more popular every day. Top universities like Harvard, MIT, Stanford have prioritized this language to be taught.

Why Python?

  • Python is easy to learn.
  • It is easier to follow along because of
  • English like structures. eg.  is used to display hello, world.
  • Python is dynamically typed. ie.
  • Python has many one-liners.                                                                   
  • So basically Python is easy to learn.

Where is Python used?

(Hint: Basically everywhere)

  1. Web Apps:
    • For web apps, Python has its own libraries like Flask, Pyramid and Django to build rapid web development.
    • Companies like DISQUIS, MOZILLA, PBS, NASA, REDDIT use Python for a web application.
  2. Scientific computing:
    • Its also used in different scientific computing.
    • Python has general libraries like NumPy, SciPy for basic scientific computations.
    • And there are specific libraries like EarthPy for earth sciences and AstroPy for Astronomy and sciences.
  3. Data Science and Machine Learning:
    • Companies like Facebook, Google, Amazon have a huge collection of our data and they market using those data.
    • For those data analytics, there is a huge number of Python libraries.
    • NumPy, SciPy, Matplotlib(Chart), Seaborn(Statistics), Plotly etc are hugely used for data analytics
    • Google has Tensorflow, Microsoft has Keras and Facebook uses PyTorch for different Machine Learning and Neural Network computation.
  4. And the list goes on……
    • Basically, Python is used everywhere
    • PyGame for Game Development and Tkinter of Python for the desktop app and there are a huge number of libraries written for GUI.

Python

  • It is an interpreted language.
  • Source code—-> Interpreter—>Output
  • The interpreter interprets the language line by line and Python virtual machine runs through it and parses it and executes it.
  • Python has different versions. Python 2, Python 2.7 but we will be using Python 3.6 for our training.

Installation Guide

  1. Goto  http://anoconda.org
  2. Download Python 3.6 version anaconda.
  3. Install it.
  4. Open Anaconda Navigator.
  5. Run Jupyter Notebook

Some differences in C and Python

After installation

  • After all, this installation Python can be simply used by calling Python command in command or terminal.
  • As we type along the Python interpreter interprets the code line by line.
  • But generally, we prefer using Jupiter Notebook because it has more advanced features and is more user-friendly than a command line interface.

Basic Data Types

As in any other programming language Python has a number of basic data types like

  • Integers
  •  Floats
  • Booleans
  • Strings

These are dynamically typed meaning we don’t explicitly need to define what type of variables are we handling within Python.

Numbers

Integers and floats work in the same way as we expect from other languages

Unlike many other languages, Python does not have unary increment(x++) or decrement(x–) operators.

Booleans

Python implements all the usual operators for Boolean logic but uses English words rather than symbols (&&, ||, etc.)

Strings

Python has great support for strings.

String also has a bunch of methods like

Containers

Python has many built-in containers like lists, tuples, dictionaries, sets.

Lists:

  • Lists are like arrays in any other language.
  • But unlike in any other language, lists is resizable and can contain elements of different type.

List implementation

For more info about lists, documentation can be really helpful.
Slicing: In addition to accessing list elements one at a time, Python provides concise syntax to access sublists; this is known as slicing.

 

 

 

 

 

 

Copyright © 2016 InfoxIT Portal. All rights reserved.
Seo wordpress plugin by www.seowizard.org.
Scroll To Top
Visit Us On FacebookVisit Us On Google PlusVisit Us On YoutubeCheck Our Feed