SlideShare a Scribd company logo
PYTHON PPT
DECISION MAKING STATEMENTS
&
LOOPS
CONTENT
DECISION MAKING
STATEMENTS
• If
• If … else
• If … elif … else
• Nested if
LOOPS
• For loop
• While loop
• Nested for
DECISION
MAKING
STATEMENTS
1) if CONDITION
if expression:
statement(s)
SYNTAX
if (expression):
statement(s)
FLOWCHART
or
EXAMPLE of if
OUTPUT
2) if ... else CONDITION
if expression:
statement(s)
SYNTAX
else :
statement(s)
FLOWCHART
EXAMPLE of if … else
OUTPUTOdd_Even Program
3) if … elif … else CONDITION
if expression:
statement(s)
SYNTAX
elif (expression):
statement(s)
FLOWCHART
else :
statement(s)
EXAMPLE of if … elif … else
OUTPUT OF if … elif … else
4) NESTED if
if expression:
statement(s)
SYNTAX
if (expression):
statement(s)
else:
statement(s)
else :
statement(s)
FLOWCHART
EXAMPLE of NESTED if
OUTPUT
LOOPS
WHAT ARE LOOPS?
•Loops are the set of
instruction which allows
us to execute a statement
or group of statements
multiple times.
DIAGRAMMATIC VIEW OF LOOP
Program runned
TYPES OF LOOP
• The different types of looping statement are:-
Loop
For loop While loop
FLOW CHART OF ‘WHILE LOOP’
EXAMPLE OF “WHILE LOOP”
Q. Write a program for sum of integer upto ‘n’ by using while loop.
condition
Conditional code
AFTER PROGRAM EXECUTION
FLOWCHART of ‘for LOOP’
/condition is
false
EXAMPLE OF “FOR LOOP”
Q.Write a program for sum of integer upto ‘n’ by using for loop.
Actual written program
Increment factor
(in-built RANGE)
Final value
Initial value
variable
AFTER PROGRAM EXECUTION
NESTED for LOOP
OUTPUT
REFERENCE
• www.tutorialpoint.com
THANK YOU
Ad

More Related Content

What's hot (20)

1.Role lexical Analyzer
1.Role lexical Analyzer1.Role lexical Analyzer
1.Role lexical Analyzer
Radhakrishnan Chinnusamy
 
If statements in c programming
If statements in c programmingIf statements in c programming
If statements in c programming
Archana Gopinath
 
Programming Paradigms
Programming ParadigmsProgramming Paradigms
Programming Paradigms
Directi Group
 
Unit I Advanced Java Programming Course
Unit I   Advanced Java Programming CourseUnit I   Advanced Java Programming Course
Unit I Advanced Java Programming Course
parveen837153
 
python conditional statement.pptx
python conditional statement.pptxpython conditional statement.pptx
python conditional statement.pptx
Dolchandra
 
sutherland- Hodgeman Polygon clipping
sutherland- Hodgeman Polygon clippingsutherland- Hodgeman Polygon clipping
sutherland- Hodgeman Polygon clipping
Arvind Kumar
 
Learn C# Programming - Encapsulation & Methods
Learn C# Programming - Encapsulation & MethodsLearn C# Programming - Encapsulation & Methods
Learn C# Programming - Encapsulation & Methods
Eng Teong Cheah
 
Introduction to programming
Introduction to programmingIntroduction to programming
Introduction to programming
Neeru Mittal
 
Find Transitive closure of a Graph Using Warshall's Algorithm
Find Transitive closure of a Graph Using Warshall's AlgorithmFind Transitive closure of a Graph Using Warshall's Algorithm
Find Transitive closure of a Graph Using Warshall's Algorithm
Safayet Hossain
 
BASICS OF MATRICES WITH APPLICATION IN ENGINEERING
BASICS OF MATRICES WITH APPLICATION IN ENGINEERINGBASICS OF MATRICES WITH APPLICATION IN ENGINEERING
BASICS OF MATRICES WITH APPLICATION IN ENGINEERING
Roshan Bhagat
 
C program compiler presentation
C program compiler presentationC program compiler presentation
C program compiler presentation
Rigvendra Kumar Vardhan
 
Chapter 5 Syntax Directed Translation
Chapter 5   Syntax Directed TranslationChapter 5   Syntax Directed Translation
Chapter 5 Syntax Directed Translation
Radhakrishnan Chinnusamy
 
Type conversion, precedence, associativity in c programming
Type conversion, precedence, associativity in c programmingType conversion, precedence, associativity in c programming
Type conversion, precedence, associativity in c programming
Dhrumil Panchal
 
Just in-time-compiler
Just in-time-compilerJust in-time-compiler
Just in-time-compiler
mohamedjahidameers
 
Recursive Function
Recursive FunctionRecursive Function
Recursive Function
Harsh Pathak
 
If else statement in c++
If else statement in c++If else statement in c++
If else statement in c++
Bishal Sharma
 
Conditional and control statement
Conditional and control statementConditional and control statement
Conditional and control statement
narmadhakin
 
Python programming : Control statements
Python programming : Control statementsPython programming : Control statements
Python programming : Control statements
Emertxe Information Technologies Pvt Ltd
 
Regular Languages
Regular LanguagesRegular Languages
Regular Languages
parmeet834
 
Isomorphic graph
Isomorphic graphIsomorphic graph
Isomorphic graph
umair khan
 
If statements in c programming
If statements in c programmingIf statements in c programming
If statements in c programming
Archana Gopinath
 
Programming Paradigms
Programming ParadigmsProgramming Paradigms
Programming Paradigms
Directi Group
 
Unit I Advanced Java Programming Course
Unit I   Advanced Java Programming CourseUnit I   Advanced Java Programming Course
Unit I Advanced Java Programming Course
parveen837153
 
python conditional statement.pptx
python conditional statement.pptxpython conditional statement.pptx
python conditional statement.pptx
Dolchandra
 
sutherland- Hodgeman Polygon clipping
sutherland- Hodgeman Polygon clippingsutherland- Hodgeman Polygon clipping
sutherland- Hodgeman Polygon clipping
Arvind Kumar
 
Learn C# Programming - Encapsulation & Methods
Learn C# Programming - Encapsulation & MethodsLearn C# Programming - Encapsulation & Methods
Learn C# Programming - Encapsulation & Methods
Eng Teong Cheah
 
Introduction to programming
Introduction to programmingIntroduction to programming
Introduction to programming
Neeru Mittal
 
Find Transitive closure of a Graph Using Warshall's Algorithm
Find Transitive closure of a Graph Using Warshall's AlgorithmFind Transitive closure of a Graph Using Warshall's Algorithm
Find Transitive closure of a Graph Using Warshall's Algorithm
Safayet Hossain
 
BASICS OF MATRICES WITH APPLICATION IN ENGINEERING
BASICS OF MATRICES WITH APPLICATION IN ENGINEERINGBASICS OF MATRICES WITH APPLICATION IN ENGINEERING
BASICS OF MATRICES WITH APPLICATION IN ENGINEERING
Roshan Bhagat
 
Type conversion, precedence, associativity in c programming
Type conversion, precedence, associativity in c programmingType conversion, precedence, associativity in c programming
Type conversion, precedence, associativity in c programming
Dhrumil Panchal
 
Recursive Function
Recursive FunctionRecursive Function
Recursive Function
Harsh Pathak
 
If else statement in c++
If else statement in c++If else statement in c++
If else statement in c++
Bishal Sharma
 
Conditional and control statement
Conditional and control statementConditional and control statement
Conditional and control statement
narmadhakin
 
Regular Languages
Regular LanguagesRegular Languages
Regular Languages
parmeet834
 
Isomorphic graph
Isomorphic graphIsomorphic graph
Isomorphic graph
umair khan
 

Similar to Decision making &_loops_in_python (8)

pds first unit module 2 MODULE FOR ppt.pptx
pds first unit module 2 MODULE FOR ppt.pptxpds first unit module 2 MODULE FOR ppt.pptx
pds first unit module 2 MODULE FOR ppt.pptx
bmit1
 
Looping concept.pptx
Looping concept.pptxLooping concept.pptx
Looping concept.pptx
AvinashJain66
 
W4-DecisionMaking.pdf. python document. CS
W4-DecisionMaking.pdf. python document. CSW4-DecisionMaking.pdf. python document. CS
W4-DecisionMaking.pdf. python document. CS
MalikaKhan21
 
Python decision making
Python   decision makingPython   decision making
Python decision making
Learnbay Datascience
 
Control satkcher ppt
Control satkcher pptControl satkcher ppt
Control satkcher ppt
6336Zeelvora
 
lecture about visual basic studio 6.0 presentation
lecture about visual basic studio 6.0 presentationlecture about visual basic studio 6.0 presentation
lecture about visual basic studio 6.0 presentation
GayathriShiva4
 
Control structure and Looping statements
Control structure and Looping statementsControl structure and Looping statements
Control structure and Looping statements
BalaKrishnan466
 
C Programming Notes and Importaint Topics
C Programming Notes and Importaint TopicsC Programming Notes and Importaint Topics
C Programming Notes and Importaint Topics
SoumyaKantiSarkar2
 
pds first unit module 2 MODULE FOR ppt.pptx
pds first unit module 2 MODULE FOR ppt.pptxpds first unit module 2 MODULE FOR ppt.pptx
pds first unit module 2 MODULE FOR ppt.pptx
bmit1
 
Looping concept.pptx
Looping concept.pptxLooping concept.pptx
Looping concept.pptx
AvinashJain66
 
W4-DecisionMaking.pdf. python document. CS
W4-DecisionMaking.pdf. python document. CSW4-DecisionMaking.pdf. python document. CS
W4-DecisionMaking.pdf. python document. CS
MalikaKhan21
 
Control satkcher ppt
Control satkcher pptControl satkcher ppt
Control satkcher ppt
6336Zeelvora
 
lecture about visual basic studio 6.0 presentation
lecture about visual basic studio 6.0 presentationlecture about visual basic studio 6.0 presentation
lecture about visual basic studio 6.0 presentation
GayathriShiva4
 
Control structure and Looping statements
Control structure and Looping statementsControl structure and Looping statements
Control structure and Looping statements
BalaKrishnan466
 
C Programming Notes and Importaint Topics
C Programming Notes and Importaint TopicsC Programming Notes and Importaint Topics
C Programming Notes and Importaint Topics
SoumyaKantiSarkar2
 
Ad

Recently uploaded (20)

AI 3-in-1: Agents, RAG, and Local Models - Brent Laster
AI 3-in-1: Agents, RAG, and Local Models - Brent LasterAI 3-in-1: Agents, RAG, and Local Models - Brent Laster
AI 3-in-1: Agents, RAG, and Local Models - Brent Laster
All Things Open
 
Q1 2025 Dropbox Earnings and Investor Presentation
Q1 2025 Dropbox Earnings and Investor PresentationQ1 2025 Dropbox Earnings and Investor Presentation
Q1 2025 Dropbox Earnings and Investor Presentation
Dropbox
 
Com fer un pla de gestió de dades amb l'eiNa DMP (en anglès)
Com fer un pla de gestió de dades amb l'eiNa DMP (en anglès)Com fer un pla de gestió de dades amb l'eiNa DMP (en anglès)
Com fer un pla de gestió de dades amb l'eiNa DMP (en anglès)
CSUC - Consorci de Serveis Universitaris de Catalunya
 
Top 5 Benefits of Using Molybdenum Rods in Industrial Applications.pptx
Top 5 Benefits of Using Molybdenum Rods in Industrial Applications.pptxTop 5 Benefits of Using Molybdenum Rods in Industrial Applications.pptx
Top 5 Benefits of Using Molybdenum Rods in Industrial Applications.pptx
mkubeusa
 
Crazy Incentives and How They Kill Security. How Do You Turn the Wheel?
Crazy Incentives and How They Kill Security. How Do You Turn the Wheel?Crazy Incentives and How They Kill Security. How Do You Turn the Wheel?
Crazy Incentives and How They Kill Security. How Do You Turn the Wheel?
Christian Folini
 
AI-proof your career by Olivier Vroom and David WIlliamson
AI-proof your career by Olivier Vroom and David WIlliamsonAI-proof your career by Olivier Vroom and David WIlliamson
AI-proof your career by Olivier Vroom and David WIlliamson
UXPA Boston
 
Unlocking Generative AI in your Web Apps
Unlocking Generative AI in your Web AppsUnlocking Generative AI in your Web Apps
Unlocking Generative AI in your Web Apps
Maximiliano Firtman
 
Building the Customer Identity Community, Together.pdf
Building the Customer Identity Community, Together.pdfBuilding the Customer Identity Community, Together.pdf
Building the Customer Identity Community, Together.pdf
Cheryl Hung
 
Dark Dynamism: drones, dark factories and deurbanization
Dark Dynamism: drones, dark factories and deurbanizationDark Dynamism: drones, dark factories and deurbanization
Dark Dynamism: drones, dark factories and deurbanization
Jakub Šimek
 
AI x Accessibility UXPA by Stew Smith and Olivier Vroom
AI x Accessibility UXPA by Stew Smith and Olivier VroomAI x Accessibility UXPA by Stew Smith and Olivier Vroom
AI x Accessibility UXPA by Stew Smith and Olivier Vroom
UXPA Boston
 
Could Virtual Threads cast away the usage of Kotlin Coroutines - DevoxxUK2025
Could Virtual Threads cast away the usage of Kotlin Coroutines - DevoxxUK2025Could Virtual Threads cast away the usage of Kotlin Coroutines - DevoxxUK2025
Could Virtual Threads cast away the usage of Kotlin Coroutines - DevoxxUK2025
João Esperancinha
 
fennec fox optimization algorithm for optimal solution
fennec fox optimization algorithm for optimal solutionfennec fox optimization algorithm for optimal solution
fennec fox optimization algorithm for optimal solution
shallal2
 
The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...
The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...
The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...
SOFTTECHHUB
 
machines-for-woodworking-shops-en-compressed.pdf
machines-for-woodworking-shops-en-compressed.pdfmachines-for-woodworking-shops-en-compressed.pdf
machines-for-woodworking-shops-en-compressed.pdf
AmirStern2
 
Smart Investments Leveraging Agentic AI for Real Estate Success.pptx
Smart Investments Leveraging Agentic AI for Real Estate Success.pptxSmart Investments Leveraging Agentic AI for Real Estate Success.pptx
Smart Investments Leveraging Agentic AI for Real Estate Success.pptx
Seasia Infotech
 
UiPath Automation Suite – Cas d'usage d'une NGO internationale basée à Genève
UiPath Automation Suite – Cas d'usage d'une NGO internationale basée à GenèveUiPath Automation Suite – Cas d'usage d'une NGO internationale basée à Genève
UiPath Automation Suite – Cas d'usage d'une NGO internationale basée à Genève
UiPathCommunity
 
On-Device or Remote? On the Energy Efficiency of Fetching LLM-Generated Conte...
On-Device or Remote? On the Energy Efficiency of Fetching LLM-Generated Conte...On-Device or Remote? On the Energy Efficiency of Fetching LLM-Generated Conte...
On-Device or Remote? On the Energy Efficiency of Fetching LLM-Generated Conte...
Ivano Malavolta
 
Bepents tech services - a premier cybersecurity consulting firm
Bepents tech services - a premier cybersecurity consulting firmBepents tech services - a premier cybersecurity consulting firm
Bepents tech services - a premier cybersecurity consulting firm
Benard76
 
DevOpsDays SLC - Platform Engineers are Product Managers.pptx
DevOpsDays SLC - Platform Engineers are Product Managers.pptxDevOpsDays SLC - Platform Engineers are Product Managers.pptx
DevOpsDays SLC - Platform Engineers are Product Managers.pptx
Justin Reock
 
Optima Cyber - Maritime Cyber Security - MSSP Services - Manolis Sfakianakis ...
Optima Cyber - Maritime Cyber Security - MSSP Services - Manolis Sfakianakis ...Optima Cyber - Maritime Cyber Security - MSSP Services - Manolis Sfakianakis ...
Optima Cyber - Maritime Cyber Security - MSSP Services - Manolis Sfakianakis ...
Mike Mingos
 
AI 3-in-1: Agents, RAG, and Local Models - Brent Laster
AI 3-in-1: Agents, RAG, and Local Models - Brent LasterAI 3-in-1: Agents, RAG, and Local Models - Brent Laster
AI 3-in-1: Agents, RAG, and Local Models - Brent Laster
All Things Open
 
Q1 2025 Dropbox Earnings and Investor Presentation
Q1 2025 Dropbox Earnings and Investor PresentationQ1 2025 Dropbox Earnings and Investor Presentation
Q1 2025 Dropbox Earnings and Investor Presentation
Dropbox
 
Top 5 Benefits of Using Molybdenum Rods in Industrial Applications.pptx
Top 5 Benefits of Using Molybdenum Rods in Industrial Applications.pptxTop 5 Benefits of Using Molybdenum Rods in Industrial Applications.pptx
Top 5 Benefits of Using Molybdenum Rods in Industrial Applications.pptx
mkubeusa
 
Crazy Incentives and How They Kill Security. How Do You Turn the Wheel?
Crazy Incentives and How They Kill Security. How Do You Turn the Wheel?Crazy Incentives and How They Kill Security. How Do You Turn the Wheel?
Crazy Incentives and How They Kill Security. How Do You Turn the Wheel?
Christian Folini
 
AI-proof your career by Olivier Vroom and David WIlliamson
AI-proof your career by Olivier Vroom and David WIlliamsonAI-proof your career by Olivier Vroom and David WIlliamson
AI-proof your career by Olivier Vroom and David WIlliamson
UXPA Boston
 
Unlocking Generative AI in your Web Apps
Unlocking Generative AI in your Web AppsUnlocking Generative AI in your Web Apps
Unlocking Generative AI in your Web Apps
Maximiliano Firtman
 
Building the Customer Identity Community, Together.pdf
Building the Customer Identity Community, Together.pdfBuilding the Customer Identity Community, Together.pdf
Building the Customer Identity Community, Together.pdf
Cheryl Hung
 
Dark Dynamism: drones, dark factories and deurbanization
Dark Dynamism: drones, dark factories and deurbanizationDark Dynamism: drones, dark factories and deurbanization
Dark Dynamism: drones, dark factories and deurbanization
Jakub Šimek
 
AI x Accessibility UXPA by Stew Smith and Olivier Vroom
AI x Accessibility UXPA by Stew Smith and Olivier VroomAI x Accessibility UXPA by Stew Smith and Olivier Vroom
AI x Accessibility UXPA by Stew Smith and Olivier Vroom
UXPA Boston
 
Could Virtual Threads cast away the usage of Kotlin Coroutines - DevoxxUK2025
Could Virtual Threads cast away the usage of Kotlin Coroutines - DevoxxUK2025Could Virtual Threads cast away the usage of Kotlin Coroutines - DevoxxUK2025
Could Virtual Threads cast away the usage of Kotlin Coroutines - DevoxxUK2025
João Esperancinha
 
fennec fox optimization algorithm for optimal solution
fennec fox optimization algorithm for optimal solutionfennec fox optimization algorithm for optimal solution
fennec fox optimization algorithm for optimal solution
shallal2
 
The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...
The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...
The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...
SOFTTECHHUB
 
machines-for-woodworking-shops-en-compressed.pdf
machines-for-woodworking-shops-en-compressed.pdfmachines-for-woodworking-shops-en-compressed.pdf
machines-for-woodworking-shops-en-compressed.pdf
AmirStern2
 
Smart Investments Leveraging Agentic AI for Real Estate Success.pptx
Smart Investments Leveraging Agentic AI for Real Estate Success.pptxSmart Investments Leveraging Agentic AI for Real Estate Success.pptx
Smart Investments Leveraging Agentic AI for Real Estate Success.pptx
Seasia Infotech
 
UiPath Automation Suite – Cas d'usage d'une NGO internationale basée à Genève
UiPath Automation Suite – Cas d'usage d'une NGO internationale basée à GenèveUiPath Automation Suite – Cas d'usage d'une NGO internationale basée à Genève
UiPath Automation Suite – Cas d'usage d'une NGO internationale basée à Genève
UiPathCommunity
 
On-Device or Remote? On the Energy Efficiency of Fetching LLM-Generated Conte...
On-Device or Remote? On the Energy Efficiency of Fetching LLM-Generated Conte...On-Device or Remote? On the Energy Efficiency of Fetching LLM-Generated Conte...
On-Device or Remote? On the Energy Efficiency of Fetching LLM-Generated Conte...
Ivano Malavolta
 
Bepents tech services - a premier cybersecurity consulting firm
Bepents tech services - a premier cybersecurity consulting firmBepents tech services - a premier cybersecurity consulting firm
Bepents tech services - a premier cybersecurity consulting firm
Benard76
 
DevOpsDays SLC - Platform Engineers are Product Managers.pptx
DevOpsDays SLC - Platform Engineers are Product Managers.pptxDevOpsDays SLC - Platform Engineers are Product Managers.pptx
DevOpsDays SLC - Platform Engineers are Product Managers.pptx
Justin Reock
 
Optima Cyber - Maritime Cyber Security - MSSP Services - Manolis Sfakianakis ...
Optima Cyber - Maritime Cyber Security - MSSP Services - Manolis Sfakianakis ...Optima Cyber - Maritime Cyber Security - MSSP Services - Manolis Sfakianakis ...
Optima Cyber - Maritime Cyber Security - MSSP Services - Manolis Sfakianakis ...
Mike Mingos
 
Ad

Decision making &_loops_in_python

  翻译: