0% found this document useful (0 votes)
21 views20 pages

Harshppt

This document is an industrial training presentation on Python programming, covering topics such as its features, data types, variables, operators, and control structures like loops and decision-making statements. It emphasizes Python's ease of use, readability, and versatility for both small and large projects. The presentation also includes a project example of a calculator implemented in Python.

Uploaded by

b221026
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views20 pages

Harshppt

This document is an industrial training presentation on Python programming, covering topics such as its features, data types, variables, operators, and control structures like loops and decision-making statements. It emphasizes Python's ease of use, readability, and versatility for both small and large projects. The presentation also includes a project example of a calculator implemented in Python.

Uploaded by

b221026
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 20

Industrial Training Presentation

• Topic – Python Programming


Language

Submitted By:- Submitted to: -

HARSH SHARMA Kiran Rathi


Ma’am
ECE Associate
Prof.-
CONTENT:-
• Introduction to Python
• Features of Python
• Indentation
• Variables
• Datatypes
• Operators
• Python Strings
• Python List
• Python Tuple
• Python Sets
• Python Dictionary
• Decision making Statements in Python
• Python Loops
About Python
Python is generally a interpreted programming
language. It is widely used general purpose, high
level programming language .It was Initially
designed by Guido van Rossum in 1991 and
developed by python Software foundation It was
mainly developed for emphasis on code readability.
Its syntax allows programmers to express concepts
in fewer lines of code. Basically it help the
programmer to write clear, logical code for small
and large scale projects as well.
Features of Python
 Easy to Code
 Free and Open Source
 Object Oriented Language
 High Level Language
 Python is Portable Language
 Python is Integerated Language
Indentation

• Indentation refers to the spaces at the beginning of a code line. Where in


other programming languages the indentation in code is for readability only,
the indentation in python is veryimportant.
• Python uses indentation to indicate a block of code
Variables

 Variables are nothing but reserved memory locations to store values.

This means that when you create a variable you reserve some space in
memory.
 Example:-

x=5
y=‘‘Car’’
print(x)
print(y)
Python Operators
Operators : Operators are used to perform mathmathical operation on variables and values.
1. Arithmetic operators: It is used with numeric values to perform common mathematical
operation.
Addition (x + y),Subtraction (x-y), Multiplication (x*y), Division (x/y), Modulus (x % y),
Exponentiation(x**y), Floor division(x//y).

2.Assignment operators: Assignment operators are used to assign the values to variables.
(=, += ==, *=, /= and so on...)

3. Comparison operators: It is used to compare the two values of variables. (==, >, < >,
<=)

4. Logical Operators: Logical operators are used to combine conditional statement. (and
Returns true if both true, or Returns true If one statement is true, not Returns False if the
results is true)
Python Datatypes

Data types are the classification of data items. It represents the kind of value that tells
what operations can be performed on a particular data.
Python supports the built in data types -
Numeric Datatype
Python numeric data type is used to hold numeric values like;
1.int - holds signed integers of non-limited length.
2.float- holds floating precision numbers and it’s accurate up to 15 decimal places.
3.complex- holds complex numbers.
• Example:- Output:-
a = 5
print("Type of a: ", type(a)) Type of a: <class ‘int’>

b = 5.0 Type of b: <class ‘float’>


print("\nType of b: ", type(b))

c = 2 + 4j Type of c: <class ‘complex’


print("\nType of c: ", type(c))
Python Strings

STRING: Strings are generally a set of characters .Strings literals in python are surrounded by either
Single quotation marks, or double quotation marks.
--'hello' is the same as "hello". String can be displayed literally with a print() function.
Example: print('hello') or print(" hello")
Assign string to a variable: It is done with the variable name followed by an
equal sign and the string.
Example: a =" hello"
print(a)
String are arrays: Like many other popular programming languages , strings in python are array of bytes
representing unicode characters. Python does not have a character data type.
Square brackets can be used to access the elements of the string.
Example: a =" hello world!"
print(a[1])
Python Lists

LIST : List is a collection which is ordered and changeable. Allows duplicate


members.
• In python, list are written with square bracket[].
• List items are indexed, the first item has index [o], the second item has index
[1] etc.
• Example-
mylist=["apple", "banana", "cherry"]
print(mylist)
Python Tuples

TUPLES: A tuple is a collection which is ordered and unchangeable.


• In python tuples are written with brackets.
• Example mytuple = ("apple", "banana", "cherry")
• Create a Tuple:
thistuple = ("apple", "banana", "cherry")
print(thistuple)
Python Sets

• A set is a collection which is unordered, unchangeable*, and unindexed.


• Sets are used to store multiple items in a single variable.
• Sets are written with curly brackets{}.
Example:-
This_set = {"apple", "banana", "cherry"}
print(This_set)
Python Dictionary

DICTIONARY: A dictionary is a collection which is unordered


changeable and
indexed.
• In python dictionaries are written with curly brackets{}, and they
have keys
and values.
• Example: thisdict = { "brand": "Ford“ , "Model": "mustang“ , "Year" :
1964}
print(thisdict)
Decision making Statements in Python

Decision making statements in python are an essential tool for any programmer.
They allow any program to make intelligent and informed decisions by evaluating
information before executing that particular code. Decision making statements can
direct a program to execute on the based of instructions if a certain condition is
True or another if it's False.
There are four types of Decision making statements in Python-
1. If statement
2. If-else statements
3. Nested if-else statements
4. If-elif ladder
Python Loops
LOOPS: Python has two primitive loop commands.
1 while loops
2 for loops
 While Loop - In python, a while loop is used to execute a block of statements
repeatedly until a given condition is satisfied. And when the condition becomes
false, the line immediately after the loop in the program is executed.
 For Loop - for loop is used for iterating over a sequence (that is either a list, a tuple, a
dictionary
, a string). With the for loops we can execute a set of statements, once for each item in a list,
tuple ,etc.
PROJECT

• CALCULATOR USING PYTHON


THANK YOU

You might also like