Skip to main content

Python Introduction

Python is a popular programming language. It was created in 1991 by Guido van Rossum.
It is used for:
  • web development (server-side),
  • software development,
  • mathematics,
  • system scripting.
Python is a widely used general-purpose, high level programming language.
It was initially designed by Guido van Rossum in 1991 and developed by Python Software Foundation. 
It was mainly developed for emphasis on code readability, and its syntax allows programmers to express concepts in fewer lines of code.
Python is a programming language that lets you work quickly and integrate systems more efficiently.
The Python IDLE (Integrated Development Environment) executes instructions one line at a time. This also lets us use it as a calculator.
There are two major Python versions- Python 2 and Python 3. Both are quite different.
Why is it called Python?
Going into etymology, Guido van Rossum named it after the comedy group Monty Python. That is why the metasyntactic variables (those we will often use to explain code syntax) used here are ‘spam’ and ‘eggs’ instead of ‘foo’ and ‘bar’. A lot of implementations today run version 2.x, but the future belongs to Python 3.x. It is also called ‘Python 3000’ or ‘Py3K’. CPython, written in C, is the most common implementation of Python.

How was Python Born?
·         The Python programming language was conceived in the late 1980s and was named after the BBC TV show Monty Python’s Flying Circus. Guido van Rossum started implementing Python at CWI in the Netherlands in December of 1989. This was a successor to the ABC programming language which was capable ofexception handling and interfacing with the Amoeba operating system.

·         On October 16 of 2000, Python 2.0 released and it had many major new features including cycle-detecting garbage collector for memory management and support for Unicode.

·     The next version of Python 3.0 released on December 3, 2008.
Now we know how Python came into the picture. So, moving ahead in this Python tutorial, let us jump to Python Architecture.
Python Architecture
Let’s now talk about Python architecture and its usual flow –

i. Parser
It uses the source code to generate an abstract syntax tree.

ii. Compiler
It turns the abstract syntax tree into Python bytecode.

iii. Interpreter
 Python Constructs:


  • Functions:       A function in Python is a collection of statements grouped under a name. You can use it whenever you want to execute all those statements at a time. You can call it wherever you want and as many times as you want in a program. A function may return a value.
  • Classes:   As we discussed earlier, Python is an object-oriented language. It supports classes and objects. A class is an abstract data type. In other words, it is a blueprint for an object of a certain kind. It holds no values. An object is a real-world entity and an instance of a class.
  • Modules  A Python module is a collection of related classes and functions. We have modules for mathematical calculations, string manipulations, web programming, and many more. We will discuss Python Module in detail in a later lesson.
  • Packages:    Python package is a collection of related modules. You can either import a package or create your own.
  • List:   List is an ordered sequence of items. It is one of the most used datatype in Python and is very flexible. All the items in a list do not need to be of the same type

What can Python do?
  • Python can be used on a server to create web applications.
  • Python can be used alongside software to create workflows.
  • Python can connect to database systems. It can also read and modify files.
  • Python can be used to handle big data and perform complex mathematics.
  • Python can be used for rapid prototyping, or for production-ready software development.
Why Python?
  • Python works on different platforms (Windows, Mac, Linux, Raspberry Pi, etc).
  • Python has a simple syntax similar to the English language.
  • Python has syntax that allows developers to write programs with fewer lines than some other programming languages.
  • Python runs on an interpreter system, meaning that code can be executed as soon as it is written. This means that prototyping can be very quick.
  • Python can be treated in a procedural way, an object-orientated way or a functional way.
Good to know
  • The most recent major version of Python is Python 3, which we shall be using in this tutorial. However, Python 2, although not being updated with anything other than security updates, is still quite popular.
  • In this tutorial Python will be written in a text editor. It is possible to write Python in an Integrated Development Environment, such as Thonny, Pycharm, Netbeans or Eclipse which are particularly useful when managing larger collections of Python files.
Python Syntax compared to other programming languages
  • Python was designed to for readability, and has some similarities to the English language with influence from mathematics.
  • Python uses new lines to complete a command, as opposed to other programming languages which often use semicolons or parentheses.
  • Python relies on indentation, using whitespace, to define scope; such as the scope of loops, functions and classes. Other programming languages often use curly-brackets for this purpose.




Comments

Popular posts from this blog

Python keyword and identifiers

Python Keywords Keywords are the reserved words in Python. We cannot use a keyword as  variable name ,  function  name or any other identifier. They are used to define the syntax and structure of the Python language. In Python, keywords are case sensitive. There are 33 keywords in Python 3.3. This number can vary slightly in course of time. All the keywords except  True ,  False  and  None  are in lowercase and they must be written as it is. The list of all the keywords are given below. Keywords in python programming language True False None and as assert break class continue def del elif else except finally for from global if import in is lambda nonlocal not or pass raise return try while with yield Python Identifiers Identifier is the name given to entities like class, functions, variables etc. in Python. It helps differentiating one entity from another. Rules for writing identi...

Python Data Types

Data Type in Python:- Python data types are different in some aspects from other programming languages.  It is simple to understand and easy to use.  Because Python is interpreted programming language and Python interpreter can determine which type of data are storing, so no need to define the data type of memory location. Every value in Python has a datatype. Since everything is an object in Python programming, data types are actually classes and variables are instance (object) of these classes. The data type determines: - ·          The possible values for that type. ·          The operations that can be done with that values. ·          Conveys the meaning of data. ·          The way values of that type can be stored. *There are various data types in Python. Some of the important type...