SlideShare a Scribd company logo
Introduction of Python
Python3
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.
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 was introduced in 2000.
6. On December 3, 2008, Python 3.0 (also called "Py3K") was released. It was
designed to rectify fundamental flaw of the language.
7. Python is influenced by the programming languages like ABC language and
Modula-3.
Why we need Python?
Python has top the charts in the recent years over other programming
languages like C, C++ and Java and is widely used by the programmers.
The software development companies prefer Python language because of its
versatile features and fewer programming codes.
The language has extensive support libraries and clean object-oriented designs
that increase two to tenfold of programmer’s productivity while using the
languages like Java, VB, Perl, C, C++ and C#.
The Python language has diversified application in the software development
companies such as in gaming, web frameworks and applications, language
development, prototyping, graphic design applications, etc.
It provides large standard libraries that include the areas like string operations,
Internet, web service tools, operating system interfaces and protocols.
Interactive Shell
The interactive shell is also interactive in the way that it stands between the
commands or actions and their execution. This means the Shell waits for commands
from the user, which it executes and returns the result of the execution. After this
the shell waits for the next input.
Applications of Python
GUI-Based Desktop Applications
Image Processing and Graphic Design Applications
Scientific and Computational Applications
Games
Web Frameworks and Web Applications
Enterprise and Business Applications
Operating Systems
Language Development
Prototyping
Advantages of Python Programming Language
Extensive Libraries
Python libraries contain code for various purposes like regular expressions,
documentation-generation, unit-testing, web browsers, threading, databases, CGI,
email, image manipulation, and more.
Extensible
Python can be extended to other languages. You can write some of your code in
languages like C++ or C. This comes in handy, especially in projects.
Improved Productivity
The language’s simplicity and extensive libraries render programmers more
productive than languages like Java and C++ do. Also, the fact that you need to
write less lets more get done.
IOT Opportunities
Since Python forms the basis of new platforms like Raspberry Pi, it finds the
future bright for Internet Of Things. This is a way to connect the language with
the real world.
Simple and Easy
When working with Java, you may have to create a class to print ‘Hello World’.
But in Python, just a print statement will do. It is also quite easy to learn,
understand, and code. This is why when people pick up Python, they have a
hard time adjusting to other more verbose languages like Java.
Readable
Because it is not such a verbose language, reading Python is much like reading
English. This is also why it is so easy to learn, understand, and code. It also
does not need curly braces to define blocks, and indentation is mandatory.
This further aids the readability of the code.
Object-Oriented
This language supports both the procedural and object-oriented programming
paradigms. While functions help us with code reusability, classes and objects
let us model the real world. A class allows the encapsulation of data and
functions into one.
Free and Open-Source
Python is freely available. But not only can you download python for free, but
you can also download its source code, make changes to it, and even
distribute it. It downloads with an extensive collection of libraries to help you
with your tasks.
Portable
When you code your project in a language like C++, you may need to make
some changes to it if you want to run it on another platform. But it isn’t the
same with Python. Here, you need to code only once, and you can run it
anywhere. This is called Write Once Run Anywhere (WORA). However, you
need to be careful enough not to include any system-dependent features.
Interpreted
Python is an interpreted language. Since statements are executed one by one,
debugging is easier than in compiled languages.
Disadvantages of Python Programming Language
Speed Limitations
We have seen that Python code is executed line by line. But since Python is
interpreted, it often results in slow execution. This, however, isn’t a problem
unless speed is a focal point for the project. In other words, unless high speed is a
requirement, the benefits offered by Python are enough to distract us from its
speed limitations.
Weak in Mobile Computing and Browsers
While it serves as an excellent server-side language, Python is much rarely seen on
the client-side. Besides that, it is rarely ever used to implement smartphone-based
applications.
Design Restrictions
As you know, Python is dynamically-typed. This means that you don’t need to
declare the type of variable while writing the code.
Underdeveloped Database Access Layers
Compared to more widely used technologies like JDBC (Java DataBase
Connectivity) and ODBC (Open DataBase Connectivity), Python’s database access
layers are a bit underdeveloped. Consequently, it is less often applied in huge
enterprises.
Interactive vs Normal Mode
Python has two basic modes normal and interactive mode. The normal mode is the
mode where the scripted and finished .py files are run in the Python interpreter.
Interactive mode is a command line shell which gives immediate feedback for each
statement, while running previously fed statements in active memory. As new lines
are fed into the interpreter, the fed program is evaluated both in part and in whole.
Python Character Set
A…….Z ASCII value 65 to 90
a……….z ASCII value 97 to 122
0……..9 ASCII value 48 to 57
Special Characters
Python Tokens
Each single unit which together combine to a statement is known as tokens.
Keywords
Python has a set of keywords that are reserved words that cannot be used as
variable names, function names, or any other identifiers. E.g. and, as, in etc.
Python Identifiers
An identifier is a name given to entities like class, functions, variables, etc. It
helps to differentiate one entity from another.
Rules for writing identifiers
Identifiers can be a combination of letters in lowercase (a to z) or uppercase (A to
Z) or digits (0 to 9) or an underscore _. Names like myClass, var_1 and
print_this_to_screen, all are valid example.
An identifier cannot start with a digit. 1variable is invalid, but variable1 is
perfectly fine.
Keywords cannot be used as identifiers.
We cannot use special symbols like !, @, #, $, % etc. in our identifier.
Identifier can be of any length.
Python is case sensitive
Python is a case-sensitive language. This means, sum and Sum are not the same.
Always name identifiers that make sense.
Python Literals
Literals can be defined as a data that is given in a variable or constant.
String literals "Arjun" , '12345'
Numeric literals 100, -26.2
Boolean literals True or False
Special literals None is used to specify to that field
that is not created.
Literal Collections Collections such as tuples, lists and
Dictionary are used in Python
Python support the following literals
Python Operators
Python language supports the following types of operators.
Arithmetic Operators
Comparison (Relational) Operators
Assignment Operators
Logical Operators
Bitwise Operators
Membership Operators
Identity Operators
Python Arithmetic Operators
Operator Example
+ Addition 10 + 20 = 30
- Subtraction 10 – 20 = -10
* Multiplication 10 * 20 = 200
/ Division 5/ 2 = 2.5
% Modulus 10 % 2 = 0
** Exponent 2**3 =8
// Integer Division 5//2 = 2
Python Comparison Operators
Operator Example
== (2== 3) is not true.
!= (2!= 3) is true.
<> (2<> 3) is true. This is similar to !=
operator.
> (2 > 3) is not true.
< (2 < 3) is true.
>= (2 >= 3) is not true.
<= (2 <= 3) is true.
Python Assignment Operators
Operator Example
= c = a + b assigns value of a + b into c
+= Add AND c += a is equivalent to c = c + a
-= Subtract AND c -= a is equivalent to c = c - a
*= Multiply AND c *= a is equivalent to c = c * a
/= Divide AND c /= a is equivalent to c = c / ac /= a
is equivalent to c = c / a
%= Modulus AND c %= a is equivalent to c = c % a
**= Exponent AND c **= a is equivalent to c = c ** a
//= Floor Division c //= a is equivalent to c = c // a
Python Bitwise Operators
Python Bitwise Operators
Operator Example
& Binary AND (a & b) (means 0000 1100)
| Binary OR (a | b) = 61 (means 0011 1101)
^ Binary XOR (a ^ b) = 49 (means 0011 0001)
~ Binary Ones
Complement
(~a ) = -61 (means 1100 0011 in 2's complement
form due to a signed binary number.
<< Binary Left Shift a << 2 = 240 (means 1111 0000)
>> Binary Right Shift a >> 2 = 15 (means 0000 1111)
Python Logical Operators
Python Logical Operators
Operator Example
and Logical AND (a and b) is true.
or Logical OR (a or b) is true.
not Logical NOT Not(a and b) is false.
Python Membership Operators
Operato
r
Example
in x in y, here in results in a 1 if x is a member of sequence
y.
not in x not in y, here not in results in a 1 if x is not a member
of sequence y.
Python Identity Operators
Operator Example
is x is y, here is results in 1 if id(x) equals id(y).
is not x is not y, here is not results in 1 if id(x) is not equal to id(y).
Python Operators Precedence
The following table lists all operators from highest precedence to lowest.
Precedence Operator
1 ** Exponent
2 ~ + - Complement, unary plus and minus
3 * / % // Multiply, divide, modulo and floor division
4 + - Addition and subtraction
5 >> << Right and left bitwise shift
6 & Bitwise 'AND'
7 ^ | Bitwise exclusive `OR' and regular `OR'
8 <= < > >= Comparison operators
9 <> == != Equality operators
10 = %= /= //= -= += *= **= Assignment operators
11 is is not Identity operators
12 in not in Membership operators
13 not or and Logical operators
Python Data Types
Python provides various standard data types that define the storage method on
each of them. The data types defined in Python are given below.
Numbers
String
List
Tuple
Dictionary
Numbers
Number stores numeric values. Python creates Number objects when a number
is assigned to a variable. For example
a = 3 , b = 5 a and b are number objects
Python supports 4 types of numeric data
int (signed integers like 10, 2, 29, etc.)
long (long integers used for a higher range of values like 908090800L, -
0x1929292L, etc.)
float (float is used to store floating point numbers like 1.9, 9.902, 15.2, etc.)
complex (complex numbers like 2.14j, 2.0 + 2.3j, etc.)
Strings
The string can be defined as the sequence of characters represented in the
quotation marks. In python, we can use single, double, or triple quotes to define a
string. String handling in python is a straightforward task since there are various
inbuilt functions and operators provided.
List
Lists are similar to arrays in C. However the list can contain data of different types.
The items stored in the list are separated with a comma (,) and enclosed within
square brackets [].
Tuple
A tuple is similar to the list in many ways. Like lists, tuples also contain the
collection of the items of different data types. The items of the tuple are separated
with a comma (,) and enclosed in parentheses ().
A tuple is a read-only data structure as we can't modify the size and value of the
items of a tuple.
Dictionary
Dictionary is an ordered set of a key-value pair of items. It is like an
associative array or a hash table where each key stores a specific value. Key
can hold any primitive data type whereas value is an arbitrary Python object.
The items in the dictionary are separated with the comma and enclosed in the
curly braces {}.
Mutable and Immutable Data Types in Python
Since everything in Python is an Object, every variable holds an object
instance. When an object is initiated, it is assigned a unique object id. Its type
is defined at runtime and once set can never change, however its state can be
changed if it is mutable. A mutable object can be changed after it is created,
and an immutable object can’t.
Mutable Data Types: int, float, bool, str, tuple
Immutable Data Types: list, set, dict
Thanks you
Contact Info
ZENUS INFOTECH INDIA PVT. LTD
Near Hotel Deep Residency, Ram Nagar Chowk
Roorkee - 247667(Uttrakhand)
Phone:01332-261250
Mobile:+91-8218088730
E-Mail:info@zenusinfotech.in

More Related Content

What's hot (20)

DOC
About python
satyabrata panda
 
PDF
WEB PROGRAMMING UNIT VIII BY BHAVSINGH MALOTH
Bhavsingh Maloth
 
PPTX
What is Python? An overview of Python for science.
Nicholas Pringle
 
PDF
Python quick guide1
Kanchilug
 
PPTX
Python Introduction | JNTUA | R19 | UNIT 1
FabMinds
 
PPTX
Python - An Introduction
Swarit Wadhe
 
PPTX
Why Python?
Adam Pah
 
PDF
3.2
Samimvez
 
PDF
Cs6660 compiler design
hari2010
 
PDF
Cp week _2.
shahidullah57
 
PPTX
Introduction to Python Basics Programming
Collaboration Technologies
 
PDF
Core python programming tutorial
Amarjeetsingh Thakur
 
PPTX
Python Programming
sameer patil
 
PDF
Fundamentals of python
BijuAugustian
 
PPTX
Programming
monishagoyal4
 
PDF
Web Programming UNIT VIII notes
Bhavsingh Maloth
 
PDF
WEB PROGRAMMING UNIT V BY BHAVSINGH MALOTH
Bhavsingh Maloth
 
PPTX
Getting Started with Python
Sankhya_Analytics
 
About python
satyabrata panda
 
WEB PROGRAMMING UNIT VIII BY BHAVSINGH MALOTH
Bhavsingh Maloth
 
What is Python? An overview of Python for science.
Nicholas Pringle
 
Python quick guide1
Kanchilug
 
Python Introduction | JNTUA | R19 | UNIT 1
FabMinds
 
Python - An Introduction
Swarit Wadhe
 
Why Python?
Adam Pah
 
Cs6660 compiler design
hari2010
 
Cp week _2.
shahidullah57
 
Introduction to Python Basics Programming
Collaboration Technologies
 
Core python programming tutorial
Amarjeetsingh Thakur
 
Python Programming
sameer patil
 
Fundamentals of python
BijuAugustian
 
Programming
monishagoyal4
 
Web Programming UNIT VIII notes
Bhavsingh Maloth
 
WEB PROGRAMMING UNIT V BY BHAVSINGH MALOTH
Bhavsingh Maloth
 
Getting Started with Python
Sankhya_Analytics
 

Similar to Introduction of Python (20)

PPTX
python_module_.................................................................
VaibhavSrivastav52
 
PPT
python introduction all the students.ppt
ArunkumarM192050
 
PPTX
python introduction initial lecture unit1.pptx
ChandraPrakash715640
 
PPTX
Introduction to python programming ( part-1)
Ziyauddin Shaik
 
PPTX
2024-25 TYBSC(CS)-PYTHON_PROG_ControlStructure.pptx
sangeeta borde
 
PPTX
Python programming
Ganesh Bhosale
 
PPTX
intro to python.pptx
UpasnaSharma37
 
PPTX
Python
Aashish Jain
 
PDF
Python final ppt
Ripal Ranpara
 
PDF
Pythonfinalppt 170822121204
wichakansroisuwan
 
PPTX
Welcome to python workshop
Mukul Kirti Verma
 
PPTX
Basic concept of Python.pptx includes design tool, identifier, variables.
supriyasarkar38
 
PPTX
Python Demo.pptx
ParveenShaik21
 
PPTX
Python Demo.pptx
ParveenShaik21
 
PPT
Python programming
saroja20
 
PPT
Python - Module 1.ppt
jaba kumar
 
PPTX
pengenalan python apa itu python untuk apa.pptx
aftaf3
 
PPTX
Python_ppt for basics of python in details
Mukul Kirti Verma
 
PPTX
Python Introduction
vikram mahendra
 
python_module_.................................................................
VaibhavSrivastav52
 
python introduction all the students.ppt
ArunkumarM192050
 
python introduction initial lecture unit1.pptx
ChandraPrakash715640
 
Introduction to python programming ( part-1)
Ziyauddin Shaik
 
2024-25 TYBSC(CS)-PYTHON_PROG_ControlStructure.pptx
sangeeta borde
 
Python programming
Ganesh Bhosale
 
intro to python.pptx
UpasnaSharma37
 
Python
Aashish Jain
 
Python final ppt
Ripal Ranpara
 
Pythonfinalppt 170822121204
wichakansroisuwan
 
Welcome to python workshop
Mukul Kirti Verma
 
Basic concept of Python.pptx includes design tool, identifier, variables.
supriyasarkar38
 
Python Demo.pptx
ParveenShaik21
 
Python Demo.pptx
ParveenShaik21
 
Python programming
saroja20
 
Python - Module 1.ppt
jaba kumar
 
pengenalan python apa itu python untuk apa.pptx
aftaf3
 
Python_ppt for basics of python in details
Mukul Kirti Verma
 
Python Introduction
vikram mahendra
 
Ad

More from ZENUS INFOTECH INDIA PVT. LTD. (14)

PDF
100+ Tally shortcut key
ZENUS INFOTECH INDIA PVT. LTD.
 
PDF
Introduction to AutoCAD Commands
ZENUS INFOTECH INDIA PVT. LTD.
 
PPTX
Introduction of Industrial Designing Software by ZENUS INFOTECH
ZENUS INFOTECH INDIA PVT. LTD.
 
PDF
ZENUS is best for CAD Training
ZENUS INFOTECH INDIA PVT. LTD.
 
PDF
BEST IT & CAD Training Compnay
ZENUS INFOTECH INDIA PVT. LTD.
 
PPTX
Project report on AutoCAD | ZENUS INFOTECH INDIA PVT. LTD.
ZENUS INFOTECH INDIA PVT. LTD.
 
PDF
PHP | ZENUS INFOTECH INDIA PVT. LTD.
ZENUS INFOTECH INDIA PVT. LTD.
 
PDF
JAVA Training | ZENUS INFOTECH INDIA PVT. LTD.
ZENUS INFOTECH INDIA PVT. LTD.
 
PDF
Ansys Training | ZENUS INFOTECH INDIA PVT. LTD.
ZENUS INFOTECH INDIA PVT. LTD.
 
PDF
MCA ( Govt. of India) approved Training company in Roorkee
ZENUS INFOTECH INDIA PVT. LTD.
 
PDF
ZENUS INFOTECH INDIA PVT. LTD. is also engage with skill India mission
ZENUS INFOTECH INDIA PVT. LTD.
 
PDF
IIT DEHLI students training latter
ZENUS INFOTECH INDIA PVT. LTD.
 
PDF
ZENUS INFOTECH INDIA PVT. LTD. is also Training Partner of RCE ENGG. COLLEGE
ZENUS INFOTECH INDIA PVT. LTD.
 
PDF
Embedded system
ZENUS INFOTECH INDIA PVT. LTD.
 
100+ Tally shortcut key
ZENUS INFOTECH INDIA PVT. LTD.
 
Introduction to AutoCAD Commands
ZENUS INFOTECH INDIA PVT. LTD.
 
Introduction of Industrial Designing Software by ZENUS INFOTECH
ZENUS INFOTECH INDIA PVT. LTD.
 
ZENUS is best for CAD Training
ZENUS INFOTECH INDIA PVT. LTD.
 
BEST IT & CAD Training Compnay
ZENUS INFOTECH INDIA PVT. LTD.
 
Project report on AutoCAD | ZENUS INFOTECH INDIA PVT. LTD.
ZENUS INFOTECH INDIA PVT. LTD.
 
PHP | ZENUS INFOTECH INDIA PVT. LTD.
ZENUS INFOTECH INDIA PVT. LTD.
 
JAVA Training | ZENUS INFOTECH INDIA PVT. LTD.
ZENUS INFOTECH INDIA PVT. LTD.
 
Ansys Training | ZENUS INFOTECH INDIA PVT. LTD.
ZENUS INFOTECH INDIA PVT. LTD.
 
MCA ( Govt. of India) approved Training company in Roorkee
ZENUS INFOTECH INDIA PVT. LTD.
 
ZENUS INFOTECH INDIA PVT. LTD. is also engage with skill India mission
ZENUS INFOTECH INDIA PVT. LTD.
 
IIT DEHLI students training latter
ZENUS INFOTECH INDIA PVT. LTD.
 
ZENUS INFOTECH INDIA PVT. LTD. is also Training Partner of RCE ENGG. COLLEGE
ZENUS INFOTECH INDIA PVT. LTD.
 
Ad

Recently uploaded (20)

PPTX
How to Create Odoo JS Dialog_Popup in Odoo 18
Celine George
 
PDF
Is Assignment Help Legal in Australia_.pdf
thomas19williams83
 
PPTX
How to Manage Allocation Report for Manufacturing Orders in Odoo 18
Celine George
 
PDF
Vani - The Voice of Excellence - Jul 2025 issue
Savipriya Raghavendra
 
PPTX
How to Create a Customer From Website in Odoo 18.pptx
Celine George
 
PPTX
Controller Request and Response in Odoo18
Celine George
 
PDF
Horarios de distribución de agua en julio
pegazohn1978
 
PPTX
How to Configure Re-Ordering From Portal in Odoo 18 Website
Celine George
 
PPTX
TRANSLATIONAL AND ROTATIONAL MOTION.pptx
KIPAIZAGABAWA1
 
PPTX
PPT-Q1-WK-3-ENGLISH Revised Matatag Grade 3.pptx
reijhongidayawan02
 
PDF
Stokey: A Jewish Village by Rachel Kolsky
History of Stoke Newington
 
PPTX
DIGITAL CITIZENSHIP TOPIC TLE 8 MATATAG CURRICULUM
ROBERTAUGUSTINEFRANC
 
PDF
The Constitution Review Committee (CRC) has released an updated schedule for ...
nservice241
 
PDF
QNL June Edition hosted by Pragya the official Quiz Club of the University of...
Pragya - UEM Kolkata Quiz Club
 
PPTX
Post Dated Cheque(PDC) Management in Odoo 18
Celine George
 
PDF
Mahidol_Change_Agent_Note_2025-06-27-29_MUSEF
Tassanee Lerksuthirat
 
PPTX
Universal immunization Programme (UIP).pptx
Vishal Chanalia
 
PPTX
Difference between write and update in odoo 18
Celine George
 
PPTX
HUMAN RESOURCE MANAGEMENT: RECRUITMENT, SELECTION, PLACEMENT, DEPLOYMENT, TRA...
PRADEEP ABOTHU
 
PPTX
Introduction to Indian Writing in English
Trushali Dodiya
 
How to Create Odoo JS Dialog_Popup in Odoo 18
Celine George
 
Is Assignment Help Legal in Australia_.pdf
thomas19williams83
 
How to Manage Allocation Report for Manufacturing Orders in Odoo 18
Celine George
 
Vani - The Voice of Excellence - Jul 2025 issue
Savipriya Raghavendra
 
How to Create a Customer From Website in Odoo 18.pptx
Celine George
 
Controller Request and Response in Odoo18
Celine George
 
Horarios de distribución de agua en julio
pegazohn1978
 
How to Configure Re-Ordering From Portal in Odoo 18 Website
Celine George
 
TRANSLATIONAL AND ROTATIONAL MOTION.pptx
KIPAIZAGABAWA1
 
PPT-Q1-WK-3-ENGLISH Revised Matatag Grade 3.pptx
reijhongidayawan02
 
Stokey: A Jewish Village by Rachel Kolsky
History of Stoke Newington
 
DIGITAL CITIZENSHIP TOPIC TLE 8 MATATAG CURRICULUM
ROBERTAUGUSTINEFRANC
 
The Constitution Review Committee (CRC) has released an updated schedule for ...
nservice241
 
QNL June Edition hosted by Pragya the official Quiz Club of the University of...
Pragya - UEM Kolkata Quiz Club
 
Post Dated Cheque(PDC) Management in Odoo 18
Celine George
 
Mahidol_Change_Agent_Note_2025-06-27-29_MUSEF
Tassanee Lerksuthirat
 
Universal immunization Programme (UIP).pptx
Vishal Chanalia
 
Difference between write and update in odoo 18
Celine George
 
HUMAN RESOURCE MANAGEMENT: RECRUITMENT, SELECTION, PLACEMENT, DEPLOYMENT, TRA...
PRADEEP ABOTHU
 
Introduction to Indian Writing in English
Trushali Dodiya
 

Introduction of Python

  • 2. Python3 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. 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 was introduced in 2000. 6. On December 3, 2008, Python 3.0 (also called "Py3K") was released. It was designed to rectify fundamental flaw of the language. 7. Python is influenced by the programming languages like ABC language and Modula-3.
  • 3. Why we need Python? Python has top the charts in the recent years over other programming languages like C, C++ and Java and is widely used by the programmers. The software development companies prefer Python language because of its versatile features and fewer programming codes. The language has extensive support libraries and clean object-oriented designs that increase two to tenfold of programmer’s productivity while using the languages like Java, VB, Perl, C, C++ and C#. The Python language has diversified application in the software development companies such as in gaming, web frameworks and applications, language development, prototyping, graphic design applications, etc. It provides large standard libraries that include the areas like string operations, Internet, web service tools, operating system interfaces and protocols.
  • 4. Interactive Shell The interactive shell is also interactive in the way that it stands between the commands or actions and their execution. This means the Shell waits for commands from the user, which it executes and returns the result of the execution. After this the shell waits for the next input. Applications of Python GUI-Based Desktop Applications Image Processing and Graphic Design Applications Scientific and Computational Applications Games Web Frameworks and Web Applications Enterprise and Business Applications Operating Systems Language Development Prototyping
  • 5. Advantages of Python Programming Language Extensive Libraries Python libraries contain code for various purposes like regular expressions, documentation-generation, unit-testing, web browsers, threading, databases, CGI, email, image manipulation, and more. Extensible Python can be extended to other languages. You can write some of your code in languages like C++ or C. This comes in handy, especially in projects. Improved Productivity The language’s simplicity and extensive libraries render programmers more productive than languages like Java and C++ do. Also, the fact that you need to write less lets more get done.
  • 6. IOT Opportunities Since Python forms the basis of new platforms like Raspberry Pi, it finds the future bright for Internet Of Things. This is a way to connect the language with the real world. Simple and Easy When working with Java, you may have to create a class to print ‘Hello World’. But in Python, just a print statement will do. It is also quite easy to learn, understand, and code. This is why when people pick up Python, they have a hard time adjusting to other more verbose languages like Java. Readable Because it is not such a verbose language, reading Python is much like reading English. This is also why it is so easy to learn, understand, and code. It also does not need curly braces to define blocks, and indentation is mandatory. This further aids the readability of the code. Object-Oriented This language supports both the procedural and object-oriented programming paradigms. While functions help us with code reusability, classes and objects let us model the real world. A class allows the encapsulation of data and functions into one.
  • 7. Free and Open-Source Python is freely available. But not only can you download python for free, but you can also download its source code, make changes to it, and even distribute it. It downloads with an extensive collection of libraries to help you with your tasks. Portable When you code your project in a language like C++, you may need to make some changes to it if you want to run it on another platform. But it isn’t the same with Python. Here, you need to code only once, and you can run it anywhere. This is called Write Once Run Anywhere (WORA). However, you need to be careful enough not to include any system-dependent features. Interpreted Python is an interpreted language. Since statements are executed one by one, debugging is easier than in compiled languages.
  • 8. Disadvantages of Python Programming Language Speed Limitations We have seen that Python code is executed line by line. But since Python is interpreted, it often results in slow execution. This, however, isn’t a problem unless speed is a focal point for the project. In other words, unless high speed is a requirement, the benefits offered by Python are enough to distract us from its speed limitations. Weak in Mobile Computing and Browsers While it serves as an excellent server-side language, Python is much rarely seen on the client-side. Besides that, it is rarely ever used to implement smartphone-based applications. Design Restrictions As you know, Python is dynamically-typed. This means that you don’t need to declare the type of variable while writing the code.
  • 9. Underdeveloped Database Access Layers Compared to more widely used technologies like JDBC (Java DataBase Connectivity) and ODBC (Open DataBase Connectivity), Python’s database access layers are a bit underdeveloped. Consequently, it is less often applied in huge enterprises. Interactive vs Normal Mode Python has two basic modes normal and interactive mode. The normal mode is the mode where the scripted and finished .py files are run in the Python interpreter. Interactive mode is a command line shell which gives immediate feedback for each statement, while running previously fed statements in active memory. As new lines are fed into the interpreter, the fed program is evaluated both in part and in whole.
  • 10. Python Character Set A…….Z ASCII value 65 to 90 a……….z ASCII value 97 to 122 0……..9 ASCII value 48 to 57 Special Characters Python Tokens Each single unit which together combine to a statement is known as tokens. Keywords Python has a set of keywords that are reserved words that cannot be used as variable names, function names, or any other identifiers. E.g. and, as, in etc. Python Identifiers An identifier is a name given to entities like class, functions, variables, etc. It helps to differentiate one entity from another.
  • 11. Rules for writing identifiers Identifiers can be a combination of letters in lowercase (a to z) or uppercase (A to Z) or digits (0 to 9) or an underscore _. Names like myClass, var_1 and print_this_to_screen, all are valid example. An identifier cannot start with a digit. 1variable is invalid, but variable1 is perfectly fine. Keywords cannot be used as identifiers. We cannot use special symbols like !, @, #, $, % etc. in our identifier. Identifier can be of any length. Python is case sensitive Python is a case-sensitive language. This means, sum and Sum are not the same. Always name identifiers that make sense. Python Literals Literals can be defined as a data that is given in a variable or constant.
  • 12. String literals "Arjun" , '12345' Numeric literals 100, -26.2 Boolean literals True or False Special literals None is used to specify to that field that is not created. Literal Collections Collections such as tuples, lists and Dictionary are used in Python Python support the following literals Python Operators Python language supports the following types of operators. Arithmetic Operators Comparison (Relational) Operators Assignment Operators Logical Operators Bitwise Operators Membership Operators Identity Operators
  • 13. Python Arithmetic Operators Operator Example + Addition 10 + 20 = 30 - Subtraction 10 – 20 = -10 * Multiplication 10 * 20 = 200 / Division 5/ 2 = 2.5 % Modulus 10 % 2 = 0 ** Exponent 2**3 =8 // Integer Division 5//2 = 2 Python Comparison Operators Operator Example == (2== 3) is not true. != (2!= 3) is true. <> (2<> 3) is true. This is similar to != operator. > (2 > 3) is not true. < (2 < 3) is true. >= (2 >= 3) is not true. <= (2 <= 3) is true.
  • 14. Python Assignment Operators Operator Example = c = a + b assigns value of a + b into c += Add AND c += a is equivalent to c = c + a -= Subtract AND c -= a is equivalent to c = c - a *= Multiply AND c *= a is equivalent to c = c * a /= Divide AND c /= a is equivalent to c = c / ac /= a is equivalent to c = c / a %= Modulus AND c %= a is equivalent to c = c % a **= Exponent AND c **= a is equivalent to c = c ** a //= Floor Division c //= a is equivalent to c = c // a Python Bitwise Operators Python Bitwise Operators Operator Example & Binary AND (a & b) (means 0000 1100) | Binary OR (a | b) = 61 (means 0011 1101) ^ Binary XOR (a ^ b) = 49 (means 0011 0001) ~ Binary Ones Complement (~a ) = -61 (means 1100 0011 in 2's complement form due to a signed binary number. << Binary Left Shift a << 2 = 240 (means 1111 0000) >> Binary Right Shift a >> 2 = 15 (means 0000 1111)
  • 15. Python Logical Operators Python Logical Operators Operator Example and Logical AND (a and b) is true. or Logical OR (a or b) is true. not Logical NOT Not(a and b) is false. Python Membership Operators Operato r Example in x in y, here in results in a 1 if x is a member of sequence y. not in x not in y, here not in results in a 1 if x is not a member of sequence y. Python Identity Operators Operator Example is x is y, here is results in 1 if id(x) equals id(y). is not x is not y, here is not results in 1 if id(x) is not equal to id(y).
  • 16. Python Operators Precedence The following table lists all operators from highest precedence to lowest. Precedence Operator 1 ** Exponent 2 ~ + - Complement, unary plus and minus 3 * / % // Multiply, divide, modulo and floor division 4 + - Addition and subtraction 5 >> << Right and left bitwise shift 6 & Bitwise 'AND' 7 ^ | Bitwise exclusive `OR' and regular `OR' 8 <= < > >= Comparison operators 9 <> == != Equality operators 10 = %= /= //= -= += *= **= Assignment operators 11 is is not Identity operators 12 in not in Membership operators 13 not or and Logical operators
  • 17. Python Data Types Python provides various standard data types that define the storage method on each of them. The data types defined in Python are given below. Numbers String List Tuple Dictionary Numbers Number stores numeric values. Python creates Number objects when a number is assigned to a variable. For example a = 3 , b = 5 a and b are number objects Python supports 4 types of numeric data int (signed integers like 10, 2, 29, etc.) long (long integers used for a higher range of values like 908090800L, - 0x1929292L, etc.) float (float is used to store floating point numbers like 1.9, 9.902, 15.2, etc.) complex (complex numbers like 2.14j, 2.0 + 2.3j, etc.)
  • 18. Strings The string can be defined as the sequence of characters represented in the quotation marks. In python, we can use single, double, or triple quotes to define a string. String handling in python is a straightforward task since there are various inbuilt functions and operators provided. List Lists are similar to arrays in C. However the list can contain data of different types. The items stored in the list are separated with a comma (,) and enclosed within square brackets []. Tuple A tuple is similar to the list in many ways. Like lists, tuples also contain the collection of the items of different data types. The items of the tuple are separated with a comma (,) and enclosed in parentheses (). A tuple is a read-only data structure as we can't modify the size and value of the items of a tuple.
  • 19. Dictionary Dictionary is an ordered set of a key-value pair of items. It is like an associative array or a hash table where each key stores a specific value. Key can hold any primitive data type whereas value is an arbitrary Python object. The items in the dictionary are separated with the comma and enclosed in the curly braces {}. Mutable and Immutable Data Types in Python Since everything in Python is an Object, every variable holds an object instance. When an object is initiated, it is assigned a unique object id. Its type is defined at runtime and once set can never change, however its state can be changed if it is mutable. A mutable object can be changed after it is created, and an immutable object can’t. Mutable Data Types: int, float, bool, str, tuple Immutable Data Types: list, set, dict
  • 20. Thanks you Contact Info ZENUS INFOTECH INDIA PVT. LTD Near Hotel Deep Residency, Ram Nagar Chowk Roorkee - 247667(Uttrakhand) Phone:01332-261250 Mobile:+91-8218088730 E-Mail:[email protected]