An
Industrial Training Presentation
on
PYTHONPROGRAMMING
At
………………
Submitted in partial fulfillment of the requirements for
the award of the degree of
…………………………
in
……………………………
(Session 2021-2022)
Submitted to -
MR. XYZ
Assistant
Professor,
(Department
Of XXX)
Submitted by-
BBBBBBBB
Roll No. :
OOOOOOOO
Batch : XXX
DEPARTMENT ……………………………………
………………………..CLZ NAME…………………….
UNI NAME………………………………….
SEPTEMBER, 2022
What is
Python
Pythonis an interpreted, object-oriented, high-level
programming language with dynamic semantics.
Python's simple, easy to learn syntax emphasizes readability
and therefore reduces the cost of program maintenance.
Python supports modules and packages, which encourages
program modularity and code reuse.
4.
Why We Use
Python
Large Standard Library
Embedded
Open source
Object Oriented Language
Interpreted Language
Speed
Easy Programming
Language
GUI Programming Support
Data
Types
NUMBERS –
1. IntegerNumber Data Type
2. Floating Number Data Type
3. Complex Number Data Type
DICTIONARY -
A dictionary is a collection which is ordered, changeable and does
not allow duplicates.
Dictionary are used to store data value in key:value pairs.
Ex. dict = {1: “a”,2:“b”}.
7.
Data
Types
LIST –
List isa collection of different values of different types of items.
The item in the list are separated with the comma(,) and enclosed
with the square brackets[].
a=[1,2,"sham","ram",21.5]
STRING –
Sequence of letters enclosed in quotes is
called string or string literal or constant.
Python supports both form of quotes i.e.
‘Hello’ , “Hello”
8.
Data
Types
SETS -
A typeof array, which is unordered as well as unindexed. It
doesn’t allow Duplicate members.
Ex. Set1 = {“ram”, “shyam”}
TUPLES –
“t = (1,2,3,one)”.
A simple immutable ordered sequence of items
Items can be of mixed types, including collection types.
9.
Python
Loops
Python has twoprimitive loop commands:
While loops
For loops
While loop - The while loop we can execute a set of statements as
long as a condition is true.
For loop - A for loop is used for iterating over a sequence (that is
either a list, a tuple, a dictionary, a set, or a string).
This is less like the for keyword in other programming languages,
and works more like an iterator method as found in other
object- orientated programming languages.
With the for loop we can execute a set of statements, once for each
item in a list, tuple, set etc.
10.
Python
Function
A functionis a block of code which only runs when it is called.
You can pass data, known as parameters, into a function.
A function can return data as a result.
Python a function is defined using the def keyword
Example :
Def statements - def name_of_function(arg1,arg2):
call ‘ name_of_function()’.
11.
Conditional Statements
‘If -elif–else’
statements -
If test
expression:
B
od
y
of
if
elif
test
expression:
Bo
dy of
‘If – else’
statements -
if
test
expression:
B
o
d
y
o
f
if
-
‘If’ statements -
num = -1
if
num > 0:
print(num, "is
a positive
number.")
print("This is also
always printed.")
12.
Python Operators
Operatorsare special symbols in Python that carry out arithmetic
or logical computation. The value that the operator operates
on is called the operand.
Example : >>>>2+3
5
Operators that Python Language supports are:
Arithmetic Operators
Assignment Operators
Comparison Operators
Logical Operators
Identity Operators
Membership Operators
Bitwise Operators.
13.
Errors and Exception
Handling
Errors :Errors are the problems in a program due to which the
program will stop the execution. On the other hand, exceptions
are raised when some internal events occur which changes the
normal flow of the program.
Two types of Error occurs in python.
Syntax errors
Logical errors (Exceptions)
Exception handling : Python has many built-in
exceptions
that are raised when your program encounters an
error
(something in the program goes wrong).
exceptions occur, the Python interpreter stops
When these
the
current
process and passes it to the calling process until it is handled. If
not handled, the program will crash.
14.
Database
Handling
. TheDBMS is a software system that enables you to create,
store, modify, retrieve, and otherwise handle data from a
database. Such systems also vary in size, ranging from small
systems that simply run on your personal computer to larger
ones running on mainframes.
Establish a connection to your database of choice.
Create a cursor to communicate with the data.
Manipulate the data using SQL (interact).
Tell the connection to either apply the SQL manipulations to the
data and make them permanent (commit), or tell it to abort those
manipulations (rollback), thus returning the data to the state before
the interactions occurred.
Close the connection to the database.
15.
File Handling
Filehandling is an important part of any web application.
Python has several functions for creating, reading, updating,
and deleting files.
The key function for working with files in Python is
the open() function.
The open() function takes two parameters; filename,
and mode.
There are three different methods (modes) for
opening a file:
"r" - Read - Default value. Opens a file for reading, error if the
file does not exist
"a" - Append - Opens a file for appending, creates the file if it
does not exist
"w" - Write - Opens a file for writing, creates the file if it does
not exist
16.
Object Oriented
Programming
(OOP)
OOP isbasically very useful in future work. Basically, this is
defined in to two categories Class and Object.
Class: Class is a type of category of overall type. They can
be
a person, animal in other words it’s a broad.
Object: From Class we get Object. These are instance
of a
class.
Inheritance: In this concept, we have two types of
class ‘Child Class’ and ‘Parent Class’. As we know in
human the meaning of inheritance is obtaining the
qualities,
some effects or any other things
child gain from their parents and from grandparents. Same in
Python the Child Class
17.
Conclusion
Python supportsboth function-oriented and structure-
oriented programming. It has features of dynamic memory
management which can make use of computational resources
efficiently. It is also compatible with all popular operating
systems and platforms. Hence this language can be universally
accepted by all programmers.
• Implementation to develop Python based GUI Application
• Directly interacted with OS using Python Programming.