Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
19 views20 pages

SSSSKKKKKK

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1/ 20

PRESENTATION

OF
INDUSTRIAL TRAINING
24-07-2023 TO 19-08-2023

DEPARTMENT
OF
COMPUTER ENGG.
SUBMITTED BY:

ANISH MALHOTRA
SBRN: 220730204002
TABLE OF CONTENT

 Python Introduction
 Python Syntax
 Python comments
 Python variable
 Python Data Types
 Python strings
 Python Booleans
 Python Operator
 Python Lists
 Python Tuples
 Python Sets
 Python Control Statement
 Python Function
Python introduction

What is Python?
• Python is a popular programming language. It was created by Guido van Rossum, and released in 1991.
• It is used for:
• web development (server-side),
• software development,
• mathematics,
• system scripting.
What can Python do?
• Python can be used on a server to create web applications.
• Python can be used alongside software to create workflows.
• Python can connect to database systems. It can also read and modify files.
• Python can be used to handle big data and perform complex mathematics.
Python Syntax :-
 Syntax of python language is very simple and easy. For e.g:-
 print(“Hello, World!”)
 OUTPUT :- Hello, World!
Python Comments :-
 Comments can be used to explain code written in a programming language.
 Comments are used to make the code more
 readable.
 Comments can be used to prevent execution when testing code.
 In Python comments can be single-line or multi-line
 For e.g:-
 #This is a comment
#written in
#more than just one line
print("Hello, World!")
Python Variables:-

Variables are containers for storing data value.


Creating Variable:-
 Python has no command for declaring a variable.A variable is created the moment you first assign a value
to it.
 You can get the data type of a variable with the type() function.
Example Output
x=5
y = "John“
print(x) 5
print(y) John
print(type(x)) <class ‘int’>
Python Data Types
Built-in Data Types:
• In programming, data type is an important concept.
• Variables can store data of different types, and different types can do different things.
•Python has the following data types built-in by default, in these categories:

Text Type: str


Numeric Types: int, float, complex
Sequence Types: list, tuple, range
Mapping Type: dict
Set Types: set, frozen set
Boolean Type: bool
Binary Types: bytes, byte array, memory view
None Type: None Type
Python Operators:-
 The operator can be defined as a symbol which is responsible for a particular operation between two
operands.Operators are the pillars of a program on which the logic is built in a specific programming
language.

Types of python operators:-


• Arithmetic operators
• Comparison operators
• Assignment Operators
• Logical Operators
• Bitwise Operators
• Membership Operators
• Identity Operators
Arithmetic Operator:- Comparison operators :-
Assignment Operators:- Logical Operators :-
Bitwise Operators :- Membership operators :-
Control flow statements :-
Functions :-

 Every function starts with a “def” keyword.


 Every function should have a unique name.
 Every function name are not a same any keyword.
 User decide the parameters are given or not.
 User decide the arguments are given or not but parameters and arguments are optional.
 But the parameters and arguments are given to the user, so user given the parameters and
arguments in parenthesis.
 Every function name without arguments should end with a (:).
 Every function has to return any value and return empty value.
Types of functions :-
1. Built in function
2. User- define function
3. Function calling
Built in function:-

 The functions which are come along with python itself are called a built in function or
predefined function. Built in function are like:- range(), id() , type(), input() etc .

Example:-python range function generates the immutable sequence of numbers starting from the given
start integer to the stop integer.

User-defined function:-
 Functions which are created by programmer according to the requirement are called a user
defined function.
Example of simple create function:-
def sample ():
x=10
print(x)
sample ()
Simple example of call function :-
def add(a,b): # define function and add parameters
sum=a+b #third variable add the value
return sum #use return statements
a=int(input(“enter 1st value:-”) #user input values
b=int(input(“enter 2nd value:-”) # user input values
c=add(a,b) #call function
Print(“the result is :-”,c) # print value
Project:-
Output:-
Thankyou…..
End
of presentation

You might also like