SlideShare a Scribd company logo
Review Python
• What is Program
• What is Programming Language
• Features of Python Language
• Installing python on your Computer
• Working mode of Python
• Variable
• Data Type in Python
• Type() Function
• Input() Function
• Operator in Python
• Precedence of Operators
• Comment in Python
• Types of Control Structures
• Conditional Statement
We all know that how computer works. It divided into
three part:-
A computer perform all these operations with the help of
program.
“A Program is a step-by-step sequence of instructions ”
that help the computer to perform the given task.
There are many programming language that you can use
to write a programs.
For Example:- C,C++, Python, Java, etc.
Input Process Output
“A programming language is a set of commands,
instructions, and other syntax use to create a
software program”
Types of Programming Language:-
Like Add, Sub, Mul
Python is a general purpose, high level
programming language.
It was created by Guido van Rossum at CWI (Centrum Wiskunde &
Informatica), and released in 1991 which is:
• Simple and interactive
• Platform independent
• Case sensitive
• Object oriented
• Interpreted language
• Use variable without declaration
It can be use for designing Console app(Where text base application is
involved like C and C++ language), Desktop app, Web application,
Mobile application, Machine learning, Robotics and perform scientific
computing.
Some popular applications which are designed using Python are:
You Tube, Google, Instagram, Quora.
You can download it for free from the following
website: www.python.org/download
After installing Python, you will get the following screen:-
Python work on two different modes:-
Modes of Python
Interactive
Mode
Script
Mode
• In the interactive mode of Python, the
interpreter executes the statement one by
one. After the first statement is executed
successfully, it move to the next statement.
How to work on Interactive Mode:-
• Click on the Start button > All program
> Python 3.7 > IDLE (Python3.7)
• It will open the Python Shell Window
where you will see the python prompt
(>>>)
Type the following command in interactive mode
and see the output:-
Interactive Mode
If you need to write long piece of
Python code then we use Script Mode.
How to write code in script mode:-
• Click on the File > New File option
or Ctrl+N
• A new file opens, write the program
and save your file by selecting the
File > Save option OR Ctrl+S
• The files in Python are saved with
the extension .py
• Once your file is saved, you can open
the same file by selecting the File >
Open option and executed the file
using F5
OR
Click on Run > Run Module
Option Output
Program
The print() function
used in the
interactive mode as
well as in the Script
mode. It is used to
display user define
messages on the
screen. Using print()
function, we can also
show the result of an
expression, once it is
processed.
We can use many separator with print() to format the
displayed result. These include:-
‘,’ (Comma):- To print the next value after a space.
‘n’ (Newline):- To print the new value in the next line.
‘t’ (Tab):- To print the next value after a tab space
(1 tab = 5 space)
• IDLE is an Integrated
Development Environment
for editing and running Python
commands. If we type an
arithmetic expression at the
python prompt and press the
Enter key, the interpreter
automatically evaluates it and
displays the result. In this
case, interpreter acts as a
calculator.
• In this mode, if you are
evaluating an expression, it is
not necessary to use the print()
function.
Smallest individual element of a program is called as
Token. Everything you see inside a program is a token.
Types Of Token
1. keywords(Reserve words)
2. Identifiers (Names that the programmer defines)
3. Literals(Constants)
4. Operators(Special Symbols that operate on data and
produce results)
5. Delimiters (Grouping, punctuation, and
assignment/binding symbols)
• Variables are containers for
storing data values.
• A variable can store one value
at a time.
• You can use variables
without declare their type.
e.g:-
A=10 (Value 10 store in
variable a)
When we specify the variable name, we need to follow
certain rules:
• A variable name must start with an alphabet(Capital or
Small) or an Underscore(_).
• A variable name consist of alphabets, digits, and
underscore. No other character is allowed.
• A keyword cannot be used as a variable name
• Space is not allowed in a variable name.
Note-
• A variable name can be of any range.
• Variable name are case sensitive (e.g.- stud_name and
Stud_name are different variable)
• Data types are the classification or categorization of data items.
• Data types represent a kind of value which determines what
operations can be performed on that data.
The main data type used in Python are :
Data type
Int
Used when you have
to work on whole
numbers (+ive or -ive)
e.g.- 100, 50
Plain Integer
-2147483648
to
+2147483647
Long Integer
>2147483647
Float
Represent
float point
value.
e.g 12.45356
String
Collection of
characters
enclosed with
single or
double quotes
e.g.- ‘Python’
Bool
Represent
logical
value in
the form
of True
and False
e.g.- 10>5
• If You want to know what type of data you are working
with, you use type() function.
• It is used to return the data type of a value.
Syntax:- Type(Object)
e.g. :-
• Input function is used to take the input from user during the
execution of program as required.
Syntax:- Input(prompt)
OR
Syntax:- Datatype(Input(prompt))
Prompt is a String, representing a default message before the input.
e.g:-
a=input(“Enter Your Name”)
Operator is a symbol that performs an operation on one
or more operands.
e.g.-
Python provides different type of operators to work.
They are:-
• Arithmetic Operator (+, -, *, %, /, //,**)
• String operator (+, *)
• Assignment operator (=)
• Relational Operator (<, >, <=,>=,!=, ==)
• Logical Operator (and, or, not)
Operators
Operands
Expression
C=A+B
Arithmetic
Operator
Used to
perform
Arithmetic
operations on
data.
Unary Operator
Work on single
Operand
Unary + and Unary –
e.g.:- a=10,a=-10
Binary Operator
Work on Two
Operand
Addition(+), Subtraction(-),
Multiply(*),
Division(/):-To divide the
number and give the result in
decimal form.
e.g.- 10/4=2.5
Integer Division(//):- To divide
the no. and give result in
integer form.
e.g.:- 10//4=2
Modulus(%):- To divide the no.
and give remainder
e.g:- 10%3=1
Exponential(**):- To find the
power of the numbers.
e,.g:- 3**4=81
Ternary Operator
Work on Three Operand
also called a conditional
expression.
Or conditional operator
e.g.:-
String Operators
Work on string values
Concatenation(+)
Used to join two string values.
e.g. :- ‘Hello’+’World’=HelloWorld
Replication(*)
Used to repeat a string for a
number of time.
e.g. :-
‘Hello’*4=HelloHelloHelloHello
Assignment Operator is used to assign a value.
e.g.:- a=10
The value 10 is assign to variable a.
Relational operators are used to show relationship
between two operands. They compare the values
assigned to the operands and give the output in Boolean
expression.
Relational operators are:-
• Less than ( < )
• Greater than ( > )
• Less than and equal to ( <= )
• Greater than equal to ( >= )
• Not equal to ( != )
• Equal to ( = )
Logical operator are used to
combine two or more conditional
statements. They provide the result
in the form of True and False.
Logical operator has three types:-
and, or, not
and:- Give result ‘True’ if all the
specified condition is true.
or :- Give result ‘True’ if any one
of the specified condition is true.
not:- It reverse or negates the
given condition. If the condition is
True, It evaluate the false and vice
versa.
Operator precedence determines which operator is performed
first in an expression.
If two operators with the same precedence are the part of an
expression, then associativity is taken into consideration.
The associativity of an operator determines the direction of operators
from which side (Either Left to Right or Vice Versa) the expression
should be resolved.
Use BODMAS (Brackets Off Divide Multiply Addition
Subtraction) to evaluate the operators in expression.
Comment are the statements that are added to a
program with the purpose of making the code easier
to understand.
Compiler and interpreters generally ignored
comment during the execution of program.
Types of Comment:-
Types of
Comment
Single Line
Comment
Multiline
Comment
Single Line comment are created by beginning a line with the
hash(#) character and are automatically terminated at the end of
line.
If you want to explain thing in more detail, which is more than one
line such comment are called multiline comment.
Note:- read
green
Statement are generally executed in a sequential
manner. If we want to change the flow of
execution of program by repeating or skipping
the execution of few statement then we use
control statements.
There are three type of control statement:-
In sequential statements, the statements in a program
are executed in a sequential manner, where one
statements are followed by other.
To find the Simple Interest First enter Principle, then
Rate, and then Time. After that it calculate the Simple
Interest.
Conditional statements are also called
decision-making statements. We use
those statements while we want to execute
a block of code when the given condition
is true or false.
There are the following Conditional
(Decision-Making) statement:-
• If statements
• If-else statements
• If-Elif-else statements
Iteration statements or loop statements allow us to
execute a block of statements as long as the condition is true.
When the given condition became false, the control comes out
of the loop and repetition stops.
Iteration statements or loop statements are used when we
need to run same code again and again, each time with a
different value.
In Python Iteration (Loops) statements are of three type :-
1. While Loop
2. For Loop
3. Nested For Loops
Conditional statement check the condition and
execute the statement accordingly. It is a part of
control structure which is use to change the order of
execution of code.
Eg.- Suppose, you want to withdraw some money from
bank ATM. You will allowed to withdraw the money only
if you enter the correct PIN.
Let us analyse it with the help of flow chart
Condition Plan of Action
If correct Pin is entered You can withdraw the money
If incorrect PIN is entered You can not withdraw the money
Flowchart:- Flow chart is a pictorial represent of
your program.
This statement is used when you want to evaluate only
one condition. If the given condition if true then it
perform the course of action other wise it skip the
statement.
Syntax:-
If <condition> :
Statement set
True condition output False condition output
It work with two blocks :- if and else. In case the
conditional expression evaluate true, the statement of
if block is executed and if the result is false, then the
statement in the else block are executed.
Syntax:- if<condition>:
statements set 1
else:
statements set 2
If block is executed else block is executed
If you want to work on multiple conditions in this case
we use if…elif…else statement.
Syntax:-
if<condition>:
statements set 1
elif<condition>:
statement set 2
else:
statement set 3
Program If block executed
elif block executed else block executed
We can also check multiple condition in the
following manner:-
Syntax:-
If<condition>:
statement set 1
elif<condition>:
statement set 2
elif<condition>:
statement set 3
elif<condition>:
statement set 4
else:
statement set 5
Data Type
Two
Control Statement
Comments
F5
F
F
T
T
T
✔
✔
✔
✔
Interactive mode is used when an user wants to run one single line or one block of
code. It runs very quickly and gives the output instantly.
Script Mode is used when the user is working with more than one single code or a
block of code.
✔
Two feature of python that make it user friendly are :-
1. Platform independent
2. Use variable without declaration
The purpose of adding comment in program is making the code easier to
understand.
For single line comment we use # and for multiline comment we use three time
double inverted comma like ( ""“ comment ""“ ) .
If statement:- This statement is used when you want to evaluate only one condition. If
the given condition is true then it perform the course of action otherwise it skip
the statement.
If…else statement:- It work with two blocks :- if and else. In case the conditional
expression evaluate true, the statement of if block is executed and if the result is
false, then the statement in the else block are executed.
When we use + operator with integer it gives the sum of the integer value
whereas if we use + operator with string value it is join two string value.
e.g. :- 10+20=30 +operator with integer value
‘Hello’+’World’ = HelloWorld +operator with string value
a=10, in this statement the value 10 is assign to variable a.
a==10, in this statement the we check whether a is equal to 10 or not
Ad

More Related Content

What's hot (20)

Function arguments In Python
Function arguments In PythonFunction arguments In Python
Function arguments In Python
Amit Upadhyay
 
How to execute a C program
How to execute a C  program How to execute a C  program
How to execute a C program
Leela Koneru
 
Intro to Python
Intro to PythonIntro to Python
Intro to Python
primeteacher32
 
Python - the basics
Python - the basicsPython - the basics
Python - the basics
University of Technology
 
Python
PythonPython
Python
Aashish Jain
 
Python Programming Language | Python Classes | Python Tutorial | Python Train...
Python Programming Language | Python Classes | Python Tutorial | Python Train...Python Programming Language | Python Classes | Python Tutorial | Python Train...
Python Programming Language | Python Classes | Python Tutorial | Python Train...
Edureka!
 
File Handling and Command Line Arguments in C
File Handling and Command Line Arguments in CFile Handling and Command Line Arguments in C
File Handling and Command Line Arguments in C
Mahendra Yadav
 
Python course syllabus
Python course syllabusPython course syllabus
Python course syllabus
Sugantha T
 
GE3171-PROBLEM SOLVING AND PYTHON PROGRAMMING LABORATORY
GE3171-PROBLEM SOLVING AND PYTHON PROGRAMMING LABORATORYGE3171-PROBLEM SOLVING AND PYTHON PROGRAMMING LABORATORY
GE3171-PROBLEM SOLVING AND PYTHON PROGRAMMING LABORATORY
ANJALAI AMMAL MAHALINGAM ENGINEERING COLLEGE
 
Introduction to Raspberrypi
Introduction to  RaspberrypiIntroduction to  Raspberrypi
Introduction to Raspberrypi
Iheb Ben Salem
 
Heuristc Search Techniques
Heuristc Search TechniquesHeuristc Search Techniques
Heuristc Search Techniques
Jismy .K.Jose
 
Pointers
PointersPointers
Pointers
Prof. Dr. K. Adisesha
 
Basics of c++ Programming Language
Basics of c++ Programming LanguageBasics of c++ Programming Language
Basics of c++ Programming Language
Ahmad Idrees
 
Networking Java Socket Programming
Networking Java Socket ProgrammingNetworking Java Socket Programming
Networking Java Socket Programming
Mousmi Pawar
 
Introduction To Python
Introduction To PythonIntroduction To Python
Introduction To Python
Vanessa Rene
 
Python training
Python trainingPython training
Python training
Kunalchauhan76
 
Data types
Data typesData types
Data types
Zahid Hussain
 
Dart ppt
Dart pptDart ppt
Dart ppt
Krishna Teja
 
C Tokens
C TokensC Tokens
C Tokens
Ripon Hossain
 
Leach & Pegasis
Leach & PegasisLeach & Pegasis
Leach & Pegasis
ReenaShekar
 
Function arguments In Python
Function arguments In PythonFunction arguments In Python
Function arguments In Python
Amit Upadhyay
 
How to execute a C program
How to execute a C  program How to execute a C  program
How to execute a C program
Leela Koneru
 
Python Programming Language | Python Classes | Python Tutorial | Python Train...
Python Programming Language | Python Classes | Python Tutorial | Python Train...Python Programming Language | Python Classes | Python Tutorial | Python Train...
Python Programming Language | Python Classes | Python Tutorial | Python Train...
Edureka!
 
File Handling and Command Line Arguments in C
File Handling and Command Line Arguments in CFile Handling and Command Line Arguments in C
File Handling and Command Line Arguments in C
Mahendra Yadav
 
Python course syllabus
Python course syllabusPython course syllabus
Python course syllabus
Sugantha T
 
Introduction to Raspberrypi
Introduction to  RaspberrypiIntroduction to  Raspberrypi
Introduction to Raspberrypi
Iheb Ben Salem
 
Heuristc Search Techniques
Heuristc Search TechniquesHeuristc Search Techniques
Heuristc Search Techniques
Jismy .K.Jose
 
Basics of c++ Programming Language
Basics of c++ Programming LanguageBasics of c++ Programming Language
Basics of c++ Programming Language
Ahmad Idrees
 
Networking Java Socket Programming
Networking Java Socket ProgrammingNetworking Java Socket Programming
Networking Java Socket Programming
Mousmi Pawar
 
Introduction To Python
Introduction To PythonIntroduction To Python
Introduction To Python
Vanessa Rene
 

Similar to Review Python (20)

BASICS OF PYTHON usefull for the student who would like to learn on their own
BASICS OF PYTHON usefull for the student who would like to learn on their ownBASICS OF PYTHON usefull for the student who would like to learn on their own
BASICS OF PYTHON usefull for the student who would like to learn on their own
Nandini485510
 
Python-Certification-Training-Day-1-2.pptx
Python-Certification-Training-Day-1-2.pptxPython-Certification-Training-Day-1-2.pptx
Python-Certification-Training-Day-1-2.pptx
muzammildev46gmailco
 
Python Basics by Akanksha Bali
Python Basics by Akanksha BaliPython Basics by Akanksha Bali
Python Basics by Akanksha Bali
Akanksha Bali
 
Python fundamentals
Python fundamentalsPython fundamentals
Python fundamentals
natnaelmamuye
 
python notes for MASTER OF COMPUTER APPLIICATION_ppt.pptx
python notes for MASTER OF COMPUTER APPLIICATION_ppt.pptxpython notes for MASTER OF COMPUTER APPLIICATION_ppt.pptx
python notes for MASTER OF COMPUTER APPLIICATION_ppt.pptx
yuvarajkumar334
 
Review of C programming language.pptx...
Review of C programming language.pptx...Review of C programming language.pptx...
Review of C programming language.pptx...
SthitaprajnaLenka1
 
introduction to python in english presentation file
introduction to python in english presentation fileintroduction to python in english presentation file
introduction to python in english presentation file
RujanTimsina1
 
Unit - 2 CAP.pptx
Unit - 2 CAP.pptxUnit - 2 CAP.pptx
Unit - 2 CAP.pptx
malekaanjum1
 
MODULE hdsfsf gefegsfs wfefwfwfg etegeg.pptx
MODULE hdsfsf gefegsfs wfefwfwfg etegeg.pptxMODULE hdsfsf gefegsfs wfefwfwfg etegeg.pptx
MODULE hdsfsf gefegsfs wfefwfwfg etegeg.pptx
prasathg214
 
Basic concept of Python.pptx includes design tool, identifier, variables.
Basic concept of Python.pptx includes design tool, identifier, variables.Basic concept of Python.pptx includes design tool, identifier, variables.
Basic concept of Python.pptx includes design tool, identifier, variables.
supriyasarkar38
 
Presgfdjfwwwwwwwwwwqwqeeqentation11.pptx
Presgfdjfwwwwwwwwwwqwqeeqentation11.pptxPresgfdjfwwwwwwwwwwqwqeeqentation11.pptx
Presgfdjfwwwwwwwwwwqwqeeqentation11.pptx
aarohanpics
 
unit1 python.pptx
unit1 python.pptxunit1 python.pptx
unit1 python.pptx
TKSanthoshRao
 
Module-1.pptx
Module-1.pptxModule-1.pptx
Module-1.pptx
Manohar Nelli
 
Introduction to Python Part-1
Introduction to Python Part-1Introduction to Python Part-1
Introduction to Python Part-1
Devashish Kumar
 
BCP_u2.pptxBCP_u2.pptxBCP_u2.pptxBCP_u2.pptx
BCP_u2.pptxBCP_u2.pptxBCP_u2.pptxBCP_u2.pptxBCP_u2.pptxBCP_u2.pptxBCP_u2.pptxBCP_u2.pptx
BCP_u2.pptxBCP_u2.pptxBCP_u2.pptxBCP_u2.pptx
RutviBaraiya
 
python BY ME-2021python anylssis(1).pptx
python BY ME-2021python anylssis(1).pptxpython BY ME-2021python anylssis(1).pptx
python BY ME-2021python anylssis(1).pptx
rekhaaarohan
 
Vks python
Vks pythonVks python
Vks python
Vinod Srivastava
 
problem solving and python programming UNIT 2.pdf
problem solving and python programming UNIT 2.pdfproblem solving and python programming UNIT 2.pdf
problem solving and python programming UNIT 2.pdf
rajesht522501
 
Problem Solving and Python Programming UNIT 2.pdf
Problem Solving and Python Programming UNIT 2.pdfProblem Solving and Python Programming UNIT 2.pdf
Problem Solving and Python Programming UNIT 2.pdf
rajesht522501
 
BASICS OF PYTHON usefull for the student who would like to learn on their own
BASICS OF PYTHON usefull for the student who would like to learn on their ownBASICS OF PYTHON usefull for the student who would like to learn on their own
BASICS OF PYTHON usefull for the student who would like to learn on their own
Nandini485510
 
Python-Certification-Training-Day-1-2.pptx
Python-Certification-Training-Day-1-2.pptxPython-Certification-Training-Day-1-2.pptx
Python-Certification-Training-Day-1-2.pptx
muzammildev46gmailco
 
Python Basics by Akanksha Bali
Python Basics by Akanksha BaliPython Basics by Akanksha Bali
Python Basics by Akanksha Bali
Akanksha Bali
 
python notes for MASTER OF COMPUTER APPLIICATION_ppt.pptx
python notes for MASTER OF COMPUTER APPLIICATION_ppt.pptxpython notes for MASTER OF COMPUTER APPLIICATION_ppt.pptx
python notes for MASTER OF COMPUTER APPLIICATION_ppt.pptx
yuvarajkumar334
 
Review of C programming language.pptx...
Review of C programming language.pptx...Review of C programming language.pptx...
Review of C programming language.pptx...
SthitaprajnaLenka1
 
introduction to python in english presentation file
introduction to python in english presentation fileintroduction to python in english presentation file
introduction to python in english presentation file
RujanTimsina1
 
MODULE hdsfsf gefegsfs wfefwfwfg etegeg.pptx
MODULE hdsfsf gefegsfs wfefwfwfg etegeg.pptxMODULE hdsfsf gefegsfs wfefwfwfg etegeg.pptx
MODULE hdsfsf gefegsfs wfefwfwfg etegeg.pptx
prasathg214
 
Basic concept of Python.pptx includes design tool, identifier, variables.
Basic concept of Python.pptx includes design tool, identifier, variables.Basic concept of Python.pptx includes design tool, identifier, variables.
Basic concept of Python.pptx includes design tool, identifier, variables.
supriyasarkar38
 
Presgfdjfwwwwwwwwwwqwqeeqentation11.pptx
Presgfdjfwwwwwwwwwwqwqeeqentation11.pptxPresgfdjfwwwwwwwwwwqwqeeqentation11.pptx
Presgfdjfwwwwwwwwwwqwqeeqentation11.pptx
aarohanpics
 
Introduction to Python Part-1
Introduction to Python Part-1Introduction to Python Part-1
Introduction to Python Part-1
Devashish Kumar
 
BCP_u2.pptxBCP_u2.pptxBCP_u2.pptxBCP_u2.pptx
BCP_u2.pptxBCP_u2.pptxBCP_u2.pptxBCP_u2.pptxBCP_u2.pptxBCP_u2.pptxBCP_u2.pptxBCP_u2.pptx
BCP_u2.pptxBCP_u2.pptxBCP_u2.pptxBCP_u2.pptx
RutviBaraiya
 
python BY ME-2021python anylssis(1).pptx
python BY ME-2021python anylssis(1).pptxpython BY ME-2021python anylssis(1).pptx
python BY ME-2021python anylssis(1).pptx
rekhaaarohan
 
problem solving and python programming UNIT 2.pdf
problem solving and python programming UNIT 2.pdfproblem solving and python programming UNIT 2.pdf
problem solving and python programming UNIT 2.pdf
rajesht522501
 
Problem Solving and Python Programming UNIT 2.pdf
Problem Solving and Python Programming UNIT 2.pdfProblem Solving and Python Programming UNIT 2.pdf
Problem Solving and Python Programming UNIT 2.pdf
rajesht522501
 
Ad

Recently uploaded (20)

Geography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjectsGeography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjects
ProfDrShaikhImran
 
Presentation on Tourism Product Development By Md Shaifullar Rabbi
Presentation on Tourism Product Development By Md Shaifullar RabbiPresentation on Tourism Product Development By Md Shaifullar Rabbi
Presentation on Tourism Product Development By Md Shaifullar Rabbi
Md Shaifullar Rabbi
 
K12 Tableau Tuesday - Algebra Equity and Access in Atlanta Public Schools
K12 Tableau Tuesday  - Algebra Equity and Access in Atlanta Public SchoolsK12 Tableau Tuesday  - Algebra Equity and Access in Atlanta Public Schools
K12 Tableau Tuesday - Algebra Equity and Access in Atlanta Public Schools
dogden2
 
To study the nervous system of insect.pptx
To study the nervous system of insect.pptxTo study the nervous system of insect.pptx
To study the nervous system of insect.pptx
Arshad Shaikh
 
apa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdfapa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdf
Ishika Ghosh
 
Handling Multiple Choice Responses: Fortune Effiong.pptx
Handling Multiple Choice Responses: Fortune Effiong.pptxHandling Multiple Choice Responses: Fortune Effiong.pptx
Handling Multiple Choice Responses: Fortune Effiong.pptx
AuthorAIDNationalRes
 
Odoo Inventory Rules and Routes v17 - Odoo Slides
Odoo Inventory Rules and Routes v17 - Odoo SlidesOdoo Inventory Rules and Routes v17 - Odoo Slides
Odoo Inventory Rules and Routes v17 - Odoo Slides
Celine George
 
Anti-Depressants pharmacology 1slide.pptx
Anti-Depressants pharmacology 1slide.pptxAnti-Depressants pharmacology 1slide.pptx
Anti-Depressants pharmacology 1slide.pptx
Mayuri Chavan
 
Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025
Mebane Rash
 
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam SuccessUltimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Mark Soia
 
Political History of Pala dynasty Pala Rulers NEP.pptx
Political History of Pala dynasty Pala Rulers NEP.pptxPolitical History of Pala dynasty Pala Rulers NEP.pptx
Political History of Pala dynasty Pala Rulers NEP.pptx
Arya Mahila P. G. College, Banaras Hindu University, Varanasi, India.
 
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Library Association of Ireland
 
Understanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s GuideUnderstanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s Guide
GS Virdi
 
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
Celine George
 
Introduction to Vibe Coding and Vibe Engineering
Introduction to Vibe Coding and Vibe EngineeringIntroduction to Vibe Coding and Vibe Engineering
Introduction to Vibe Coding and Vibe Engineering
Damian T. Gordon
 
Presentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem KayaPresentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem Kaya
MIPLM
 
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACYUNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
DR.PRISCILLA MARY J
 
Quality Contril Analysis of Containers.pdf
Quality Contril Analysis of Containers.pdfQuality Contril Analysis of Containers.pdf
Quality Contril Analysis of Containers.pdf
Dr. Bindiya Chauhan
 
YSPH VMOC Special Report - Measles Outbreak Southwest US 5-3-2025.pptx
YSPH VMOC Special Report - Measles Outbreak  Southwest US 5-3-2025.pptxYSPH VMOC Special Report - Measles Outbreak  Southwest US 5-3-2025.pptx
YSPH VMOC Special Report - Measles Outbreak Southwest US 5-3-2025.pptx
Yale School of Public Health - The Virtual Medical Operations Center (VMOC)
 
How to Subscribe Newsletter From Odoo 18 Website
How to Subscribe Newsletter From Odoo 18 WebsiteHow to Subscribe Newsletter From Odoo 18 Website
How to Subscribe Newsletter From Odoo 18 Website
Celine George
 
Geography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjectsGeography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjects
ProfDrShaikhImran
 
Presentation on Tourism Product Development By Md Shaifullar Rabbi
Presentation on Tourism Product Development By Md Shaifullar RabbiPresentation on Tourism Product Development By Md Shaifullar Rabbi
Presentation on Tourism Product Development By Md Shaifullar Rabbi
Md Shaifullar Rabbi
 
K12 Tableau Tuesday - Algebra Equity and Access in Atlanta Public Schools
K12 Tableau Tuesday  - Algebra Equity and Access in Atlanta Public SchoolsK12 Tableau Tuesday  - Algebra Equity and Access in Atlanta Public Schools
K12 Tableau Tuesday - Algebra Equity and Access in Atlanta Public Schools
dogden2
 
To study the nervous system of insect.pptx
To study the nervous system of insect.pptxTo study the nervous system of insect.pptx
To study the nervous system of insect.pptx
Arshad Shaikh
 
apa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdfapa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdf
Ishika Ghosh
 
Handling Multiple Choice Responses: Fortune Effiong.pptx
Handling Multiple Choice Responses: Fortune Effiong.pptxHandling Multiple Choice Responses: Fortune Effiong.pptx
Handling Multiple Choice Responses: Fortune Effiong.pptx
AuthorAIDNationalRes
 
Odoo Inventory Rules and Routes v17 - Odoo Slides
Odoo Inventory Rules and Routes v17 - Odoo SlidesOdoo Inventory Rules and Routes v17 - Odoo Slides
Odoo Inventory Rules and Routes v17 - Odoo Slides
Celine George
 
Anti-Depressants pharmacology 1slide.pptx
Anti-Depressants pharmacology 1slide.pptxAnti-Depressants pharmacology 1slide.pptx
Anti-Depressants pharmacology 1slide.pptx
Mayuri Chavan
 
Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025
Mebane Rash
 
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam SuccessUltimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Mark Soia
 
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Library Association of Ireland
 
Understanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s GuideUnderstanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s Guide
GS Virdi
 
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
Celine George
 
Introduction to Vibe Coding and Vibe Engineering
Introduction to Vibe Coding and Vibe EngineeringIntroduction to Vibe Coding and Vibe Engineering
Introduction to Vibe Coding and Vibe Engineering
Damian T. Gordon
 
Presentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem KayaPresentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem Kaya
MIPLM
 
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACYUNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
DR.PRISCILLA MARY J
 
Quality Contril Analysis of Containers.pdf
Quality Contril Analysis of Containers.pdfQuality Contril Analysis of Containers.pdf
Quality Contril Analysis of Containers.pdf
Dr. Bindiya Chauhan
 
How to Subscribe Newsletter From Odoo 18 Website
How to Subscribe Newsletter From Odoo 18 WebsiteHow to Subscribe Newsletter From Odoo 18 Website
How to Subscribe Newsletter From Odoo 18 Website
Celine George
 
Ad

Review Python

  • 2. • What is Program • What is Programming Language • Features of Python Language • Installing python on your Computer • Working mode of Python • Variable • Data Type in Python • Type() Function • Input() Function • Operator in Python • Precedence of Operators • Comment in Python • Types of Control Structures • Conditional Statement
  • 3. We all know that how computer works. It divided into three part:- A computer perform all these operations with the help of program. “A Program is a step-by-step sequence of instructions ” that help the computer to perform the given task. There are many programming language that you can use to write a programs. For Example:- C,C++, Python, Java, etc. Input Process Output
  • 4. “A programming language is a set of commands, instructions, and other syntax use to create a software program” Types of Programming Language:- Like Add, Sub, Mul
  • 5. Python is a general purpose, high level programming language. It was created by Guido van Rossum at CWI (Centrum Wiskunde & Informatica), and released in 1991 which is: • Simple and interactive • Platform independent • Case sensitive • Object oriented • Interpreted language • Use variable without declaration It can be use for designing Console app(Where text base application is involved like C and C++ language), Desktop app, Web application, Mobile application, Machine learning, Robotics and perform scientific computing. Some popular applications which are designed using Python are: You Tube, Google, Instagram, Quora.
  • 6. You can download it for free from the following website: www.python.org/download After installing Python, you will get the following screen:-
  • 7. Python work on two different modes:- Modes of Python Interactive Mode Script Mode
  • 8. • In the interactive mode of Python, the interpreter executes the statement one by one. After the first statement is executed successfully, it move to the next statement. How to work on Interactive Mode:- • Click on the Start button > All program > Python 3.7 > IDLE (Python3.7) • It will open the Python Shell Window where you will see the python prompt (>>>)
  • 9. Type the following command in interactive mode and see the output:- Interactive Mode
  • 10. If you need to write long piece of Python code then we use Script Mode. How to write code in script mode:- • Click on the File > New File option or Ctrl+N • A new file opens, write the program and save your file by selecting the File > Save option OR Ctrl+S • The files in Python are saved with the extension .py • Once your file is saved, you can open the same file by selecting the File > Open option and executed the file using F5 OR Click on Run > Run Module Option Output Program
  • 11. The print() function used in the interactive mode as well as in the Script mode. It is used to display user define messages on the screen. Using print() function, we can also show the result of an expression, once it is processed.
  • 12. We can use many separator with print() to format the displayed result. These include:- ‘,’ (Comma):- To print the next value after a space. ‘n’ (Newline):- To print the new value in the next line. ‘t’ (Tab):- To print the next value after a tab space (1 tab = 5 space)
  • 13. • IDLE is an Integrated Development Environment for editing and running Python commands. If we type an arithmetic expression at the python prompt and press the Enter key, the interpreter automatically evaluates it and displays the result. In this case, interpreter acts as a calculator. • In this mode, if you are evaluating an expression, it is not necessary to use the print() function.
  • 14. Smallest individual element of a program is called as Token. Everything you see inside a program is a token. Types Of Token 1. keywords(Reserve words) 2. Identifiers (Names that the programmer defines) 3. Literals(Constants) 4. Operators(Special Symbols that operate on data and produce results) 5. Delimiters (Grouping, punctuation, and assignment/binding symbols)
  • 15. • Variables are containers for storing data values. • A variable can store one value at a time. • You can use variables without declare their type. e.g:- A=10 (Value 10 store in variable a)
  • 16. When we specify the variable name, we need to follow certain rules: • A variable name must start with an alphabet(Capital or Small) or an Underscore(_). • A variable name consist of alphabets, digits, and underscore. No other character is allowed. • A keyword cannot be used as a variable name • Space is not allowed in a variable name. Note- • A variable name can be of any range. • Variable name are case sensitive (e.g.- stud_name and Stud_name are different variable)
  • 17. • Data types are the classification or categorization of data items. • Data types represent a kind of value which determines what operations can be performed on that data. The main data type used in Python are : Data type Int Used when you have to work on whole numbers (+ive or -ive) e.g.- 100, 50 Plain Integer -2147483648 to +2147483647 Long Integer >2147483647 Float Represent float point value. e.g 12.45356 String Collection of characters enclosed with single or double quotes e.g.- ‘Python’ Bool Represent logical value in the form of True and False e.g.- 10>5
  • 18. • If You want to know what type of data you are working with, you use type() function. • It is used to return the data type of a value. Syntax:- Type(Object) e.g. :-
  • 19. • Input function is used to take the input from user during the execution of program as required. Syntax:- Input(prompt) OR Syntax:- Datatype(Input(prompt)) Prompt is a String, representing a default message before the input. e.g:- a=input(“Enter Your Name”)
  • 20. Operator is a symbol that performs an operation on one or more operands. e.g.- Python provides different type of operators to work. They are:- • Arithmetic Operator (+, -, *, %, /, //,**) • String operator (+, *) • Assignment operator (=) • Relational Operator (<, >, <=,>=,!=, ==) • Logical Operator (and, or, not) Operators Operands Expression C=A+B
  • 21. Arithmetic Operator Used to perform Arithmetic operations on data. Unary Operator Work on single Operand Unary + and Unary – e.g.:- a=10,a=-10 Binary Operator Work on Two Operand Addition(+), Subtraction(-), Multiply(*), Division(/):-To divide the number and give the result in decimal form. e.g.- 10/4=2.5 Integer Division(//):- To divide the no. and give result in integer form. e.g.:- 10//4=2 Modulus(%):- To divide the no. and give remainder e.g:- 10%3=1 Exponential(**):- To find the power of the numbers. e,.g:- 3**4=81 Ternary Operator Work on Three Operand also called a conditional expression. Or conditional operator
  • 23. String Operators Work on string values Concatenation(+) Used to join two string values. e.g. :- ‘Hello’+’World’=HelloWorld Replication(*) Used to repeat a string for a number of time. e.g. :- ‘Hello’*4=HelloHelloHelloHello
  • 24. Assignment Operator is used to assign a value. e.g.:- a=10 The value 10 is assign to variable a.
  • 25. Relational operators are used to show relationship between two operands. They compare the values assigned to the operands and give the output in Boolean expression. Relational operators are:- • Less than ( < ) • Greater than ( > ) • Less than and equal to ( <= ) • Greater than equal to ( >= ) • Not equal to ( != ) • Equal to ( = )
  • 26. Logical operator are used to combine two or more conditional statements. They provide the result in the form of True and False. Logical operator has three types:- and, or, not and:- Give result ‘True’ if all the specified condition is true. or :- Give result ‘True’ if any one of the specified condition is true. not:- It reverse or negates the given condition. If the condition is True, It evaluate the false and vice versa.
  • 27. Operator precedence determines which operator is performed first in an expression. If two operators with the same precedence are the part of an expression, then associativity is taken into consideration. The associativity of an operator determines the direction of operators from which side (Either Left to Right or Vice Versa) the expression should be resolved. Use BODMAS (Brackets Off Divide Multiply Addition Subtraction) to evaluate the operators in expression.
  • 28. Comment are the statements that are added to a program with the purpose of making the code easier to understand. Compiler and interpreters generally ignored comment during the execution of program. Types of Comment:- Types of Comment Single Line Comment Multiline Comment
  • 29. Single Line comment are created by beginning a line with the hash(#) character and are automatically terminated at the end of line. If you want to explain thing in more detail, which is more than one line such comment are called multiline comment. Note:- read green
  • 30. Statement are generally executed in a sequential manner. If we want to change the flow of execution of program by repeating or skipping the execution of few statement then we use control statements. There are three type of control statement:-
  • 31. In sequential statements, the statements in a program are executed in a sequential manner, where one statements are followed by other. To find the Simple Interest First enter Principle, then Rate, and then Time. After that it calculate the Simple Interest.
  • 32. Conditional statements are also called decision-making statements. We use those statements while we want to execute a block of code when the given condition is true or false. There are the following Conditional (Decision-Making) statement:- • If statements • If-else statements • If-Elif-else statements
  • 33. Iteration statements or loop statements allow us to execute a block of statements as long as the condition is true. When the given condition became false, the control comes out of the loop and repetition stops. Iteration statements or loop statements are used when we need to run same code again and again, each time with a different value. In Python Iteration (Loops) statements are of three type :- 1. While Loop 2. For Loop 3. Nested For Loops
  • 34. Conditional statement check the condition and execute the statement accordingly. It is a part of control structure which is use to change the order of execution of code. Eg.- Suppose, you want to withdraw some money from bank ATM. You will allowed to withdraw the money only if you enter the correct PIN. Let us analyse it with the help of flow chart Condition Plan of Action If correct Pin is entered You can withdraw the money If incorrect PIN is entered You can not withdraw the money
  • 35. Flowchart:- Flow chart is a pictorial represent of your program.
  • 36. This statement is used when you want to evaluate only one condition. If the given condition if true then it perform the course of action other wise it skip the statement. Syntax:- If <condition> : Statement set True condition output False condition output
  • 37. It work with two blocks :- if and else. In case the conditional expression evaluate true, the statement of if block is executed and if the result is false, then the statement in the else block are executed. Syntax:- if<condition>: statements set 1 else: statements set 2 If block is executed else block is executed
  • 38. If you want to work on multiple conditions in this case we use if…elif…else statement. Syntax:- if<condition>: statements set 1 elif<condition>: statement set 2 else: statement set 3 Program If block executed elif block executed else block executed
  • 39. We can also check multiple condition in the following manner:- Syntax:- If<condition>: statement set 1 elif<condition>: statement set 2 elif<condition>: statement set 3 elif<condition>: statement set 4 else: statement set 5
  • 42. Interactive mode is used when an user wants to run one single line or one block of code. It runs very quickly and gives the output instantly. Script Mode is used when the user is working with more than one single code or a block of code. ✔ Two feature of python that make it user friendly are :- 1. Platform independent 2. Use variable without declaration The purpose of adding comment in program is making the code easier to understand. For single line comment we use # and for multiline comment we use three time double inverted comma like ( ""“ comment ""“ ) .
  • 43. If statement:- This statement is used when you want to evaluate only one condition. If the given condition is true then it perform the course of action otherwise it skip the statement. If…else statement:- It work with two blocks :- if and else. In case the conditional expression evaluate true, the statement of if block is executed and if the result is false, then the statement in the else block are executed. When we use + operator with integer it gives the sum of the integer value whereas if we use + operator with string value it is join two string value. e.g. :- 10+20=30 +operator with integer value ‘Hello’+’World’ = HelloWorld +operator with string value a=10, in this statement the value 10 is assign to variable a. a==10, in this statement the we check whether a is equal to 10 or not