A Powerpoint Presentation On Python: by Durga Prasad Kopanathi
A Powerpoint Presentation On Python: by Durga Prasad Kopanathi
A Powerpoint Presentation On Python: by Durga Prasad Kopanathi
PowerPoint Presentation
on
Python
By
Durga Prasad Kopanathi
Contents:
Introduction
Features of Python
Identifiers
Keyword
Lines and Indentations
Comment
Data Types
Type Casting
Operators
Input and Output Statements
Flow Control
Functions
Generators
Modules
Packages
File Handling
Exception Handling
Python Logging
Introduction:
Interpreted, Object-oriented, High-level programming language.
It was developed by Guido Van Rassam in 1989 and made available to public in 1991
It was implemented based on procedure oriented, Object oriented, Modular programming
languages and Scripting Language.
Beginners Language
Use of Python:
The most common important application areas are
Web Applications , Developing games, Desktop Applications,
Database Application, MI and AI, data visualization and in
Features of Python
Simple and easy to learn
Freeware and Open Source
High Level Programming language
Platform Independent
Portability
Dynamically Typed
Both Procedure Oriented and Object Oriented
Interpreted
Embedded
Identifiers
An identifier is a name given to entities like class, functions, variables, etc. It helps to
differentiate one entity from another.
Rules of Identifiers:
An identifier name must start with a letter or the underscore character,Class must start with
uppercase remaining lower case
An identifier name can’t start with number
An identifier name only contain alpha-numeric and underscores.
Identifier names are case sensitive.
Single underscore private
Two underscore strongly private
Examples:cash,cash123,cash_123
Keywords:
A keyword is a reserved word whose meaning is already defined.
Keywords cannot be used as a variable.
As of python 3.8 there are 35 keywords.
Len(),count(),strip() etc….
List:
it is ordered and changeable allows duplicate members.
List can be written as list of comma-separated values(items) between square brackets.
Items in the list need not be of the same type.
List indices start at ‘0’ in forward direction and with ‘-1’ in backward direction.
Eg: list1=[1,2,3]
List2=[1,’abc’,12.3]
It contains inbuilt functions like :len(),min().max(),append() etc..
Tuple:
Python provides us with the two inbuilt functions as input() and output().
Flow Control
Flow control describes the order in which statements will be executed at runtime.
Flow control is of 3 types in python
1 Conditional Statements
if
else
elif
2 Transfer Control statements
break
continue
pass
3 Iterative Statements
for
while
Functions:
A function is a block of organized, reusable code that is used to
perform a single, related action.
Ifa group of statements is repeatedly required then it is
recommended to write as a single unit which we can call it
many no.of times by it’s name with or without passing
parameters based on our requirement. And this unit is nothing
but a function.
Inpython there are two types of functions:In python there
are two types of functions:
--Built in Functions
--User defined Functions
1.Builtin Functions:
The functions which comes by default with the Python software are called as Built
in functions.
Ex: id(),Type() etc,..
2.User Defined functions
The functions which are defined by the user(Programmer) are called as user
defined functions by using def keyword
Syntax:
def function_name:
Body of the functions
Return value
Ex:
def wish():
Print(“Hello! Good Morning”)
wish()
wish()
Modules:
A group of functions, variables and classes saved to a file, which is nothing but module.
Every Python file (.py) acts as a module.
ex: test.py a=5,b=4
def sum()
return a+b
another file: import test
test.sum()
output:9
Packages
File Handling
As the part of programming requirement, we have to store our data permanently for future
purpose. For this requirement we should go for files.
Opening a File: