Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

CSMSS College of Polytechnic Programming With Pyton-22616

• What is Python?
Python is a popular programming language. Python is a general-purpose interpreted, interactive,
object-oriented, and high-level programming language. It was created by Guido van Rossum during
1985- 1990 and released in 1991. Like Perl, Python source code is also available under the GNU
General Public License (GPL). It is used for Web development (server-side), software development,
mathematics, system scripting.

• What can Python do?


1. Python can be used on a server to create web applications.
2. Python can be used alongside software to create workflows.
3. Python can connect to database systems. It can also read and modify files.
4. Python can be used to handle big data and perform complex mathematics.
5. Python can be used for rapid prototyping, or for production-ready software development.

• Python Features

Python provides lots of features that are listed below.


1. Easy to code:
Python is high level programming language. Python is very easy to learn language as compared to
other language like c, c#, java script, java etc. It is very easy to code in python language and
anybody can learn python basic in few hours or days. It is also developer-friendly language.
2. Easy to Read:
Python code looks like simple English words. There is no use of semicolons or brackets, and the
indentations define the code block. You can tell what the code is supposed to do simply by
looking at it.
3. Free and Open Source:
Python language is freely available at official website and you can download it easily. Since, it is
open-source; this means that source code is also available to the public. So you can download it
as, use it as well as share it.
4. Object-Oriented Language:
One of the key features of python is Object-Oriented programming. Python supports object
oriented language and concepts of classes, objects, encapsulation etc.
5. GUI Programming Support:

Page 1 of 7
CSMSS College of Polytechnic Programming With Pyton-22616

Graphical Users interfaces can be made using a module such as PyQt5, PyQt4, wxPython or Tk in
python. PyQt5 is the most popular option for creating graphical apps with Python.
6. High-Level Language:
Python is a high-level language. When we write programs in python, we do not need to remember
the system architecture, nor do we need to manage the memory.
7. Extensible feature:
Python is Extensible language. We can write our some python code into c or c++ language and
also we can compile that code in c/c++ language.
8. Python is Portable language:
Python language is also a portable language. for example, if we have python code for windows
and if we want to run this code on other platform such as Linux, Unix and Mac then we do not
need to change it, we can run this code on any platform.
9. Python is Integrated language:
Python is also an Integrated language because we can easily integrated python with other language
like c, c++ etc.
10. Interpreted Language:
When a programming language is interpreted, it means that the source code is executed line by
line, and not all at once. Programming languages such as C++ or Java are not interpreted, and
hence need to be compiled first to run them. There is no need to compile Python because it is
processed at runtime by the interpreter.
11. Large Standard Library:
Python has a large standard library which provides rich set of module and functions so you do not
have to write your own code for every single thing. There are many libraries present in python for
such as regular expressions, unit-testing, web browsers etc.
12. Robust Standard Library:
Python has an extensive standard library available for anyone to use. This means
that programmers don’t have to write their code for every single thing unlike other programming
languages. There are libraries for image manipulation, databases, unit-testing, expressions and a
lot of other functionalities. In addition to the standard library, there is also a growing collection
of thousands of components, which are all available in the Python Package Index.
13. Portable:
Python is portable in the sense that the same code can be used on different machines. Suppose
you write a Python code on a Mac. If you want to run it on Windows or Linux later, you don’t

Page 2 of 7
CSMSS College of Polytechnic Programming With Pyton-22616

have to make any changes to it. As such, there is no need to write a program multiple times for
several platforms.
14. Simplify Complex Software Development:
Python can be used to develop both desktop and web apps and complex scientific and numerical
applications. Python's data analysis features help you create custom big data solutions without so
much time and effort. You can also use the Python data visualization libraries and APIs to
present data in a more appealing way. Several advanced software developers use Python to
accomplish high-end AI and natural language processing tasks.
15. Other Advanced Programming Features
Python contains several advanced programming features such as generators (used to create
iterators with a different approach that most other languages) and list comprehensions (used to
create new lists from other iterables). Python also has automatic memory management
eliminating the need to manually allocate and free memory in the code.
16. Expressive
Python needs to use only a few lines of code to perform complex tasks. For example, to display
Hello World, you simply need to type one line - print(“Hello World”). Other languages like Java
or C would take up multiple lines to execute this.
17. Dynamically Typed Language:
Many programming languages need to declare the type of the variable before runtime. With
Python, the type of the variable can be decided during runtime. This makes Python a
dynamically typed language.
For example, if you have to assign an integer value 20 to a variable “x”, you don’t need to write
int x = 20. You just have to write x = 15.

❖ Python History and Versions

1. Python laid its foundation in the late 1980s.


2. The implementation of Python was started in the December 1989 by Guido Van Rossum at
CWI in Netherland.
3. In February 1991, van Rossum published the code (labeled version 0.9.0) to alt.sources.
4. In 1994, Python 1.0 was released with new features like: lambda, map, filter, and reduce.
5. Python 2.0 added new features like: list comprehensions, garbage collection system.
6. On December 3, 2008, Python 3.0 (also called "Py3K") was released. It was designed to rectify
fundamental flaw of the language.

Page 3 of 7
CSMSS College of Polytechnic Programming With Pyton-22616

7. ABC programming language is said to be the predecessor of Python language which was capable
of Exception Handling and interfacing with Amoeba Operating System.
8. Python is influenced by following programming languages:
i. ABC language.
ii. Modula-3

❖ Python Version List

Python programming language is being updated regularly with new features and supports. There are lots
of updations in python versions, started from 1994 to current release.

A list of python versions with its released date is given below.

Python Version Released Date


Python 1.0 January 1994
Python 1.5 December 31, 1997
Python 1.6 September 5, 2000
Python 2.0 October 16, 2000
Python 2.1 April 17, 2001
Python 2.2 December 21, 2001
Python 2.3 July 29, 2003
Python 2.4 November 30, 2004
Python 2.5 September 19, 2006
Python 2.6 October 1, 2008
Python 2.7 July 3, 2010
Python 3.0 December 3, 2008
Python 3.1 June 27, 2009
Python 3.2 February 20, 2011
Python 3.3 September 29, 2012
Python 3.4 March 16, 2014
Python 3.5 September 13, 2015
Python 3.6 December 23, 2016
Python 3.7 June 27, 2018

❖ Python Applications
Python is known for its general purpose nature that makes it applicable in almost each domain of
software development. Python as a whole can be used in any sphere of development.
Here, we are specifing applications areas where python can be applied.
1) Web Applications

Page 4 of 7
CSMSS College of Polytechnic Programming With Pyton-22616

We can use Python to develop web applications. It provides libraries to handle internet protocols such
as HTML and XML, JSON, Email processing, request, beautifulSoup, Feedparser etc. It also provides
Frameworks such as Django, Pyramid, Flask etc to design and delelop web based applications. Some
important developments are: PythonWikiEngines, Pocoo, PythonBlogSoftware etc.
2) Desktop GUI Applications
Python provides Tk GUI library to develop user interface in python based application. Some other
useful toolkits wxWidgets, Kivy, pyqt that are useable on several platforms. The Kivy is popular for
writing multitouch applications.
3) Software Development
Python is helpful for software development process. It works as a support language and can be used
for build control and management, testing etc.
4) Scientific and Numeric
Python is popular and widely used in scientific and numeric computing. Some useful library and
package are SciPy, Pandas, IPython etc. SciPy is group of packages of engineering, science and
mathematics.
5) Business Applications
Python is used to build Bussiness applications like ERP and e-commerce systems. Tryton is a high
level application platform.
6) Console Based Application
We can use Python to develop console based applications. For example: IPython.
7) Audio or Video based Applications
Python is awesome to perform multiple tasks and can be used to develop multimedia applications.
Some of real applications are: TimPlayer, cplay etc.
8) 3D CAD Applications
To create CAD application Fandango is a real application which provides full features of CAD.
9) Enterprise Applications
Python can be used to create applications which can be used within an Enterprise or an Organization.
Some real time applications are: OpenErp, Tryton, Picalo etc.
10) Applications for Images
Using Python several application can be developed for image. Applications developed are: VPython,
Gogh, imgSeek etc.

❖ Python Building Blocks

Page 5 of 7
CSMSS College of Polytechnic Programming With Pyton-22616

• Identifiers:

Python Identifier is the name we give to identify a variable, function, class, module or other object. That
means whenever we want to give an entity a name, that’s called identifier. Sometimes variable and
identifier are often misunderstood as same but they are not.
o The first character of the variable must be an alphabet or underscore ( _ ).
o All the characters except the first character may be an alphabet of lower-case (a-z), upper-case (A-
Z), underscore or digit (0-9).
o Identifier name must not contain any white-space, or special character (!, @, #, %, ^, &, *).
o Identifier name must not be similar to any keyword defined in the language.
o Identifier names are case sensitive for example myname, and MyName is not the same.
o Examples of valid identifiers: a123, _n, n_9, etc.
o Examples of invalid identifiers: 1a, n%4, n 9, etc.

Though these are hard rules for writing identifiers, also there are some naming conventions which are
not mandatory but rather good practices to follow.

o Class names start with an uppercase letter. All other identifiers start with a lowercase letter.
o Starting an identifier with a single leading underscore indicates the identifier is private.
o If the identifier starts and ends with two underscores, than means the identifier is language-
defined special name.
o While c = 10 is valid, writing count = 10 would make more sense and it would be easier to
figure out what it does even when you look at your code after a long time.
o Multiple words can be separated using an underscore, for example this_is_a_variable.

• Variables:
A variable, as the name indicates is something whose value is changeable over time. In fact a variable
is a memory location where a value can be stored. Later we can retrieve the value to use. But for doing
it we need to give a nickname to that memory location so that we can refer to it. That’s identifier, the
nickname.
Python does not bound us to declare variable before using in the application. It allows us to create
variable at required time. We don't need to declare explicitly variable in Python. When we assign any
value to the variable that variable is declared automatically.
The equal (=) operator is used to assign value to a variable. The operand to the left of the = operator
is the name of the variable and the operand to the right of the = operator is the value stored in the
variable
Multiple Assignment

Page 6 of 7
CSMSS College of Polytechnic Programming With Pyton-22616

Python allows us to assign a value to multiple variables in a single statement which is also known as
multiple assignment.
1. Assigning single value to multiple variables
x=y=z=50
2. Assigning multiple values to multiple variables:
a,b,c = 1,2,"john"

• Python Keywords
Python Keywords are special reserved words which convey a special meaning to the compiler/interpreter.
Each keyword has a special meaning and a specific operation. These keywords can't be used as variable.
Following is the List of Python Keywords.
False def if raise None Del Import return True elif in try
and else is while as except lambda with assert finally nonlocal yield
break for not class from or continue global pass

Page 7 of 7

You might also like