SlideShare a Scribd company logo
1 of 8
PHYTON
• Python is a dynamic, high-level, free open source, and
interpreted programming language .
• It supports object-oriented programming as well as procedural-
oriented programming.
• In Python, we don't need to declare the type of variable
because it is a dynamically typed language.
• Python is commonly used for developing websites and
software, task automation, data analysis, and data visualization.
CONTROL FLOW STATEMENT
Python statements do not have a return value and are used to
perform actions and control the flow of the program
Control flow statements in Python are used to control the order in
which statements are executed in a program. They allow you to
make decisions, repeat actions, and create more complex logic in
your code. The primary control flow statements in Python include:
Conditional Statements (if, elif, else):
•if: Executes a block of code if a condition is true.
•elif (short for "else if"): Allows you to specify additional conditions to
check if the preceding if condition is false.
•else: Executes a block of code if no previous if or elif conditions are
true.
EX:
x = 10
if x > 0:
print("x is positive")
elif x == 0:
print("x is zero")
else:
print("x is negative")
Loops (for and while):
•for: Iterates over a sequence (e.g., a list, tuple, or string) or any iterable
object and executes a block of code for each item in the sequence.
•while: Repeats a block of code as long as a given condition is true.
Example (for loop):
fruits = ["apple", "banana", "cherry"]
for fruit in fruits:
print(fruit)
Example
(while loop):
count = 0
while count < 5:
print(count)
Control Flow Keywords:
•break: Terminates the current loop and resumes
execution at the next statement after the loop.
•continue: Skips the rest of the current iteration of a loop
and continues with the next iteration.
•pass: Used as a placeholder for code that has no effect.
It is often used to create empty code blocks.
Example (break and continue):
• for i in range(1, 10):
if i == 5:
break # exit the loop when i equals 5
• elif i == 3:
continue # skip the rest of the current iteration when i equals 3
print(i)
Exception Handling (try, except, finally):
•try: Defines a block of code to be tested for exceptions.
•except: Specifies the block of code to be executed if an exception occurs
within the try block.
•finally: Specifies a block of code that will be executed regardless of
whether an exception occurs.
• try:
result = 10 / 0
• except ZeroDivisionError:
print("Division by zero error!")
• finally:
print("Execution completed.")

More Related Content

Similar to com.pptx

Decision Making & Loops
Decision Making & LoopsDecision Making & Loops
Decision Making & LoopsAkhil Kaushik
 
Exception Handling in Python
Exception Handling in PythonException Handling in Python
Exception Handling in PythonDrJasmineBeulahG
 
PPT_203105211_3.pptx
PPT_203105211_3.pptxPPT_203105211_3.pptx
PPT_203105211_3.pptxSaurabhNage1
 
Python - Introduction
Python - IntroductionPython - Introduction
Python - Introductionstn_tkiller
 
This is all about control flow in python intruducing the Break and Continue.pptx
This is all about control flow in python intruducing the Break and Continue.pptxThis is all about control flow in python intruducing the Break and Continue.pptx
This is all about control flow in python intruducing the Break and Continue.pptxelezearrepil1
 
6 Iterative Statements.pptx
6 Iterative Statements.pptx6 Iterative Statements.pptx
6 Iterative Statements.pptxssuser8e50d8
 
While-For-loop in python used in college
While-For-loop in python used in collegeWhile-For-loop in python used in college
While-For-loop in python used in collegessuser7a7cd61
 
IoT-Week1-Day1-Lab.pptx
IoT-Week1-Day1-Lab.pptxIoT-Week1-Day1-Lab.pptx
IoT-Week1-Day1-Lab.pptxafsheenfaiq2
 
Python Decision Making And Loops.pdf
Python Decision Making And Loops.pdfPython Decision Making And Loops.pdf
Python Decision Making And Loops.pdfNehaSpillai1
 
Control_Statements_in_Python.pptx
Control_Statements_in_Python.pptxControl_Statements_in_Python.pptx
Control_Statements_in_Python.pptxKoteswari Kasireddy
 
Mastering Python lesson 3a
Mastering Python lesson 3aMastering Python lesson 3a
Mastering Python lesson 3aRuth Marvin
 
Introduction To Programming with Python Lecture 2
Introduction To Programming with Python Lecture 2Introduction To Programming with Python Lecture 2
Introduction To Programming with Python Lecture 2Syed Farjad Zia Zaidi
 

Similar to com.pptx (20)

python ppt.pptx
python ppt.pptxpython ppt.pptx
python ppt.pptx
 
Review Python
Review PythonReview Python
Review Python
 
Decision Making & Loops
Decision Making & LoopsDecision Making & Loops
Decision Making & Loops
 
Exception Handling in Python
Exception Handling in PythonException Handling in Python
Exception Handling in Python
 
PPT_203105211_3.pptx
PPT_203105211_3.pptxPPT_203105211_3.pptx
PPT_203105211_3.pptx
 
Python - Introduction
Python - IntroductionPython - Introduction
Python - Introduction
 
This is all about control flow in python intruducing the Break and Continue.pptx
This is all about control flow in python intruducing the Break and Continue.pptxThis is all about control flow in python intruducing the Break and Continue.pptx
This is all about control flow in python intruducing the Break and Continue.pptx
 
Python Flow Control
Python Flow ControlPython Flow Control
Python Flow Control
 
6 Iterative Statements.pptx
6 Iterative Statements.pptx6 Iterative Statements.pptx
6 Iterative Statements.pptx
 
Slide 6_Control Structures.pdf
Slide 6_Control Structures.pdfSlide 6_Control Structures.pdf
Slide 6_Control Structures.pdf
 
While-For-loop in python used in college
While-For-loop in python used in collegeWhile-For-loop in python used in college
While-For-loop in python used in college
 
IoT-Week1-Day1-Lab.pptx
IoT-Week1-Day1-Lab.pptxIoT-Week1-Day1-Lab.pptx
IoT-Week1-Day1-Lab.pptx
 
Python Decision Making And Loops.pdf
Python Decision Making And Loops.pdfPython Decision Making And Loops.pdf
Python Decision Making And Loops.pdf
 
Control structures pyhton
Control structures  pyhtonControl structures  pyhton
Control structures pyhton
 
Control_Statements_in_Python.pptx
Control_Statements_in_Python.pptxControl_Statements_in_Python.pptx
Control_Statements_in_Python.pptx
 
Mastering Python lesson 3a
Mastering Python lesson 3aMastering Python lesson 3a
Mastering Python lesson 3a
 
Python session3
Python session3Python session3
Python session3
 
Loops c++
Loops c++Loops c++
Loops c++
 
module 2.pptx
module 2.pptxmodule 2.pptx
module 2.pptx
 
Introduction To Programming with Python Lecture 2
Introduction To Programming with Python Lecture 2Introduction To Programming with Python Lecture 2
Introduction To Programming with Python Lecture 2
 

More from PriyadharshanBobby (13)

autocorrelation.pptx
autocorrelation.pptxautocorrelation.pptx
autocorrelation.pptx
 
BUDJET 23.pptx
BUDJET 23.pptxBUDJET 23.pptx
BUDJET 23.pptx
 
AEC502-1.
AEC502-1.AEC502-1.
AEC502-1.
 
ENGLISH.pptx
ENGLISH.pptxENGLISH.pptx
ENGLISH.pptx
 
Ethics.pptx
Ethics.pptxEthics.pptx
Ethics.pptx
 
Ethics.pptx
Ethics.pptxEthics.pptx
Ethics.pptx
 
Presentation-WPS Office-1.pptx
Presentation-WPS Office-1.pptxPresentation-WPS Office-1.pptx
Presentation-WPS Office-1.pptx
 
arrowsimpossibilitytheorem-220603081823-4733ec7f (1).pptx
arrowsimpossibilitytheorem-220603081823-4733ec7f (1).pptxarrowsimpossibilitytheorem-220603081823-4733ec7f (1).pptx
arrowsimpossibilitytheorem-220603081823-4733ec7f (1).pptx
 
IPR-Patent.pptx
IPR-Patent.pptxIPR-Patent.pptx
IPR-Patent.pptx
 
NR forestry.pptx
NR forestry.pptxNR forestry.pptx
NR forestry.pptx
 
NR kurznets curve.pptx
NR kurznets curve.pptxNR kurznets curve.pptx
NR kurznets curve.pptx
 
R studio.pptx
R studio.pptxR studio.pptx
R studio.pptx
 
MARKETING value chain.pptx
MARKETING value chain.pptxMARKETING value chain.pptx
MARKETING value chain.pptx
 

Recently uploaded

Zuja dropshipping via API with DroFx.pptx
Zuja dropshipping via API with DroFx.pptxZuja dropshipping via API with DroFx.pptx
Zuja dropshipping via API with DroFx.pptxolyaivanovalion
 
Best VIP Call Girls Noida Sector 22 Call Me: 8448380779
Best VIP Call Girls Noida Sector 22 Call Me: 8448380779Best VIP Call Girls Noida Sector 22 Call Me: 8448380779
Best VIP Call Girls Noida Sector 22 Call Me: 8448380779Delhi Call girls
 
Best VIP Call Girls Noida Sector 39 Call Me: 8448380779
Best VIP Call Girls Noida Sector 39 Call Me: 8448380779Best VIP Call Girls Noida Sector 39 Call Me: 8448380779
Best VIP Call Girls Noida Sector 39 Call Me: 8448380779Delhi Call girls
 
April 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's AnalysisApril 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's Analysismanisha194592
 
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptx
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptxBPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptx
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptxMohammedJunaid861692
 
Edukaciniai dropshipping via API with DroFx
Edukaciniai dropshipping via API with DroFxEdukaciniai dropshipping via API with DroFx
Edukaciniai dropshipping via API with DroFxolyaivanovalion
 
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...amitlee9823
 
Accredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdfAccredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdfadriantubila
 
Midocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxMidocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxolyaivanovalion
 
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...amitlee9823
 
FESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfFESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfMarinCaroMartnezBerg
 
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 nightCheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 nightDelhi Call girls
 
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort ServiceBDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort ServiceDelhi Call girls
 
BigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptxBigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptxolyaivanovalion
 
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Callshivangimorya083
 
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...amitlee9823
 
Discover Why Less is More in B2B Research
Discover Why Less is More in B2B ResearchDiscover Why Less is More in B2B Research
Discover Why Less is More in B2B Researchmichael115558
 
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...amitlee9823
 

Recently uploaded (20)

Zuja dropshipping via API with DroFx.pptx
Zuja dropshipping via API with DroFx.pptxZuja dropshipping via API with DroFx.pptx
Zuja dropshipping via API with DroFx.pptx
 
Best VIP Call Girls Noida Sector 22 Call Me: 8448380779
Best VIP Call Girls Noida Sector 22 Call Me: 8448380779Best VIP Call Girls Noida Sector 22 Call Me: 8448380779
Best VIP Call Girls Noida Sector 22 Call Me: 8448380779
 
Best VIP Call Girls Noida Sector 39 Call Me: 8448380779
Best VIP Call Girls Noida Sector 39 Call Me: 8448380779Best VIP Call Girls Noida Sector 39 Call Me: 8448380779
Best VIP Call Girls Noida Sector 39 Call Me: 8448380779
 
April 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's AnalysisApril 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's Analysis
 
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptx
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptxBPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptx
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptx
 
Edukaciniai dropshipping via API with DroFx
Edukaciniai dropshipping via API with DroFxEdukaciniai dropshipping via API with DroFx
Edukaciniai dropshipping via API with DroFx
 
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
 
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
 
Accredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdfAccredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdf
 
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get CytotecAbortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
 
Midocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxMidocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFx
 
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
 
FESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfFESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdf
 
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 nightCheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
 
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort ServiceBDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
 
BigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptxBigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptx
 
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
 
Discover Why Less is More in B2B Research
Discover Why Less is More in B2B ResearchDiscover Why Less is More in B2B Research
Discover Why Less is More in B2B Research
 
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
 

com.pptx

  • 1. PHYTON • Python is a dynamic, high-level, free open source, and interpreted programming language . • It supports object-oriented programming as well as procedural- oriented programming. • In Python, we don't need to declare the type of variable because it is a dynamically typed language. • Python is commonly used for developing websites and software, task automation, data analysis, and data visualization.
  • 2. CONTROL FLOW STATEMENT Python statements do not have a return value and are used to perform actions and control the flow of the program Control flow statements in Python are used to control the order in which statements are executed in a program. They allow you to make decisions, repeat actions, and create more complex logic in your code. The primary control flow statements in Python include:
  • 3. Conditional Statements (if, elif, else): •if: Executes a block of code if a condition is true. •elif (short for "else if"): Allows you to specify additional conditions to check if the preceding if condition is false. •else: Executes a block of code if no previous if or elif conditions are true. EX: x = 10 if x > 0: print("x is positive") elif x == 0: print("x is zero") else: print("x is negative")
  • 4. Loops (for and while): •for: Iterates over a sequence (e.g., a list, tuple, or string) or any iterable object and executes a block of code for each item in the sequence. •while: Repeats a block of code as long as a given condition is true. Example (for loop): fruits = ["apple", "banana", "cherry"] for fruit in fruits: print(fruit) Example (while loop): count = 0 while count < 5: print(count)
  • 5. Control Flow Keywords: •break: Terminates the current loop and resumes execution at the next statement after the loop. •continue: Skips the rest of the current iteration of a loop and continues with the next iteration. •pass: Used as a placeholder for code that has no effect. It is often used to create empty code blocks.
  • 6. Example (break and continue): • for i in range(1, 10): if i == 5: break # exit the loop when i equals 5 • elif i == 3: continue # skip the rest of the current iteration when i equals 3 print(i)
  • 7. Exception Handling (try, except, finally): •try: Defines a block of code to be tested for exceptions. •except: Specifies the block of code to be executed if an exception occurs within the try block. •finally: Specifies a block of code that will be executed regardless of whether an exception occurs.
  • 8. • try: result = 10 / 0 • except ZeroDivisionError: print("Division by zero error!") • finally: print("Execution completed.")