Chapter7-Introduction To Python
Chapter7-Introduction To Python
Python
Jincy M Nelson
THRS
PYTHON
• A programming language developed
by Guido Van Rossum in feb-1991.
• Named after a comedy show namely
‘Monty Python’s Flying Circus’.
• It is based on ABC language.
• It is an open source language.
Features of Python
It is an open source, so it can be
modified and redistributed.
Uses a few keywords and
clear ,simply English like structure.
Can run on variety of platforms.
Support procedure oriented as well as
object oriented programming.
Features of Python
It support Graphical user interface.
It is compatible with C,C++ languages
etc.
Used in game development, data
base application, web application ,
Artificial Intelligence.
Lesser time required to learn Pyhton
as it has simple and concise code.
Features of Python
Distinguish between input, output and
error message by different colour
code.
Has large set of libraries with various
module functions.
Has automatic memory management.
Provide interface to all major
databases.
Applications of Python
• Amazon uses python to analyse customer’s
buying habits and search patterns.
• Facebook uses python to process images.
• Google uses python in search system.
• NASA uses python for scientific
programming tasks.
• Python is used in AI systems.
Python Character Set:
• A set of Valid characters that a language can recognize.
• A character set includes:
Output:
Type of a: <class 'int'>
Type of b: <class 'float'>
Type of c: <class 'float'>
Explicit type conversion
• User convert the data type of an object
to the required data type.
• We use predefined functions like int(),
float(),complex(), bool(), str(), tuple(),
list() ,dict() etc to perform explicit type
conversion.
• This type conversion is also known as
type casting.
Input
a=100
b=20.50
c='567'
print('Variable a converted into string:',str(a))
print('Variable a converted into float:',float(a))
print('Variable b converted into integer:',int(b))
print('Variable b converted into string:',str(b))
print('Variable c converted into integer:',int(c))
print('Variable c converted into float:',float(c))
print('Variable a converted into list:',list(c))
OUTPUT
Variable a converted into string: 100
Variable a converted into float: 100.0
Variable b converted into integer: 20
Variable b converted into string: 20.5
Variable c converted into integer: 567
Variable c converted into float: 567.0
Variable a converted into list: ['5', '6', '7']
Operators