SlideShare a Scribd company logo
1 of 8
LEARNING OBJECTIVE
 Learn to use IF statements to execute
code under certain circumstances.
LEARNING OUTCOMES
 I understand the meaning of different
Boolean conditions...
 I can set up a condition using an if
statement in Python...
 I can set up more than one condition
using an elif and else statement in
Python...
STARTER
A boolean condition is one that can have only two values true or
false. The boolean comparison operators are as follows:
Learning outcomes:
 I understand the meaning of different Boolean
conditions...
 I can set up a condition using an if statement in
Python...
 I can set up more than one condition using an elif
and else statement in Python...
MAIN TASK 1
Here we say if a condition is true or false
Now have a go at completing Task 1 on Worksheet 5.
Learning outcomes:
 I understand the meaning of different Boolean
conditions...
 I can set up a condition using an if statement in
Python...
 I can set up more than one condition using an elif
and else statement in Python...
MINI PLENARY
Task 2 on your worksheet requires you to
explain what an IF statement does.
Provide an example of an IF statement to
back up your explanation.
Learning outcomes:
 I understand the meaning of different Boolean
conditions...
 I can set up a condition using an if statement in
Python...
 I can set up more than one condition using an elif
and else statement in Python...
MAIN TASK 2
You can tell the computer to do something different
when the condition isn’t true using the else
keyword:
Now attempt Task 3 on Worksheet 5
Learning outcomes:
 I understand the meaning of different Boolean
conditions...
 I can set up a condition using an if statement in
Python...
 I can set up more than one condition using an elif
and else statement in Python...
PLENARY
You have 5 minutes to work out the pay for both workers.
Learning outcomes:
 I understand the meaning of different Boolean
conditions...
 I can set up a condition using an if statement in
Python...
 I can set up more than one condition using an elif
and else statement in Python...

More Related Content

What's hot

Decision properties of reular languages
Decision properties of reular languagesDecision properties of reular languages
Decision properties of reular languagesSOMNATHMORE2
 
IP addressing seminar ppt
IP addressing seminar pptIP addressing seminar ppt
IP addressing seminar pptSmriti Rastogi
 
Informatics Practices class XI
Informatics Practices class XIInformatics Practices class XI
Informatics Practices class XIHarshit Saini
 
Looping statement in python
Looping statement in pythonLooping statement in python
Looping statement in pythonRaginiJain21
 
Introduction of tcp, ip & udp
Introduction of tcp, ip & udpIntroduction of tcp, ip & udp
Introduction of tcp, ip & udprahul kundu
 
python conditional statement.pptx
python conditional statement.pptxpython conditional statement.pptx
python conditional statement.pptxDolchandra
 
OSI Model - Open Systems Interconnection
OSI Model - Open Systems InterconnectionOSI Model - Open Systems Interconnection
OSI Model - Open Systems InterconnectionAdeel Rasheed
 
Looping statement in vb.net
Looping statement in vb.netLooping statement in vb.net
Looping statement in vb.netilakkiya
 
data-link layer protocols
data-link layer protocols  data-link layer protocols
data-link layer protocols BE Smârt
 
Cisco Packet Tracer Overview
Cisco Packet Tracer OverviewCisco Packet Tracer Overview
Cisco Packet Tracer OverviewAli Usman
 

What's hot (20)

Turing machine-TOC
Turing machine-TOCTuring machine-TOC
Turing machine-TOC
 
Computer Organization
Computer OrganizationComputer Organization
Computer Organization
 
Decision properties of reular languages
Decision properties of reular languagesDecision properties of reular languages
Decision properties of reular languages
 
Ascii 03
Ascii 03Ascii 03
Ascii 03
 
Programming Fundamentals
Programming FundamentalsProgramming Fundamentals
Programming Fundamentals
 
Acid properties
Acid propertiesAcid properties
Acid properties
 
IP addressing seminar ppt
IP addressing seminar pptIP addressing seminar ppt
IP addressing seminar ppt
 
Informatics Practices class XI
Informatics Practices class XIInformatics Practices class XI
Informatics Practices class XI
 
Looping statement in python
Looping statement in pythonLooping statement in python
Looping statement in python
 
Introduction of tcp, ip & udp
Introduction of tcp, ip & udpIntroduction of tcp, ip & udp
Introduction of tcp, ip & udp
 
python conditional statement.pptx
python conditional statement.pptxpython conditional statement.pptx
python conditional statement.pptx
 
OSI Model - Open Systems Interconnection
OSI Model - Open Systems InterconnectionOSI Model - Open Systems Interconnection
OSI Model - Open Systems Interconnection
 
Career in python
Career in pythonCareer in python
Career in python
 
Threads in JAVA
Threads in JAVAThreads in JAVA
Threads in JAVA
 
Java basic
Java basicJava basic
Java basic
 
Looping statement in vb.net
Looping statement in vb.netLooping statement in vb.net
Looping statement in vb.net
 
data-link layer protocols
data-link layer protocols  data-link layer protocols
data-link layer protocols
 
IPV6 ADDRESS
IPV6 ADDRESSIPV6 ADDRESS
IPV6 ADDRESS
 
RAID LEVELS
RAID LEVELSRAID LEVELS
RAID LEVELS
 
Cisco Packet Tracer Overview
Cisco Packet Tracer OverviewCisco Packet Tracer Overview
Cisco Packet Tracer Overview
 

Viewers also liked

Year 7 lesson 1 introduction to programming
Year 7 lesson 1   introduction to programmingYear 7 lesson 1   introduction to programming
Year 7 lesson 1 introduction to programmingtmoncrieff
 
Year 7 lesson 4 interactive and script mode
Year 7 lesson 4   interactive and script modeYear 7 lesson 4   interactive and script mode
Year 7 lesson 4 interactive and script modetmoncrieff
 
Year 7 lesson 3 variables and while loops
Year 7 lesson 3   variables and while loopsYear 7 lesson 3   variables and while loops
Year 7 lesson 3 variables and while loopstmoncrieff
 
Year 7 lesson 2 text and maths
Year 7 lesson 2   text and mathsYear 7 lesson 2   text and maths
Year 7 lesson 2 text and mathstmoncrieff
 
Python Programming Essentials - M16 - Control Flow Statements and Loops
Python Programming Essentials - M16 - Control Flow Statements and LoopsPython Programming Essentials - M16 - Control Flow Statements and Loops
Python Programming Essentials - M16 - Control Flow Statements and LoopsP3 InfoTech Solutions Pvt. Ltd.
 
Conditional Loops Python
Conditional Loops PythonConditional Loops Python
Conditional Loops Pythonprimeteacher32
 

Viewers also liked (7)

Year 7 lesson 1 introduction to programming
Year 7 lesson 1   introduction to programmingYear 7 lesson 1   introduction to programming
Year 7 lesson 1 introduction to programming
 
Year 7 lesson 4 interactive and script mode
Year 7 lesson 4   interactive and script modeYear 7 lesson 4   interactive and script mode
Year 7 lesson 4 interactive and script mode
 
Year 7 lesson 3 variables and while loops
Year 7 lesson 3   variables and while loopsYear 7 lesson 3   variables and while loops
Year 7 lesson 3 variables and while loops
 
Year 7 lesson 2 text and maths
Year 7 lesson 2   text and mathsYear 7 lesson 2   text and maths
Year 7 lesson 2 text and maths
 
Python Programming Essentials - M16 - Control Flow Statements and Loops
Python Programming Essentials - M16 - Control Flow Statements and LoopsPython Programming Essentials - M16 - Control Flow Statements and Loops
Python Programming Essentials - M16 - Control Flow Statements and Loops
 
Conditional Loops Python
Conditional Loops PythonConditional Loops Python
Conditional Loops Python
 
Python
PythonPython
Python
 

More from tmoncrieff

Lesson 3-health-and-safety
Lesson 3-health-and-safetyLesson 3-health-and-safety
Lesson 3-health-and-safetytmoncrieff
 
Lesson 2-human-computer
Lesson 2-human-computerLesson 2-human-computer
Lesson 2-human-computertmoncrieff
 
Lesson 4 binary numbers
Lesson 4   binary numbersLesson 4   binary numbers
Lesson 4 binary numberstmoncrieff
 
Lesson 1 inputs and outputs
Lesson 1   inputs and outputsLesson 1   inputs and outputs
Lesson 1 inputs and outputstmoncrieff
 
Lesson 4 binary numbers
Lesson 4   binary numbersLesson 4   binary numbers
Lesson 4 binary numberstmoncrieff
 
Lesson 3-health-and-safety
Lesson 3-health-and-safetyLesson 3-health-and-safety
Lesson 3-health-and-safetytmoncrieff
 
Lesson 2-human-computer
Lesson 2-human-computerLesson 2-human-computer
Lesson 2-human-computertmoncrieff
 
Lesson 1 inputs and outputs
Lesson 1   inputs and outputsLesson 1   inputs and outputs
Lesson 1 inputs and outputstmoncrieff
 
Year 7 lesson 2 text and maths
Year 7 lesson 2   text and mathsYear 7 lesson 2   text and maths
Year 7 lesson 2 text and mathstmoncrieff
 
Lesson 1 inputs and outputs
Lesson 1   inputs and outputsLesson 1   inputs and outputs
Lesson 1 inputs and outputstmoncrieff
 
16 btec12 first_bus_u8_ps2
16 btec12 first_bus_u8_ps216 btec12 first_bus_u8_ps2
16 btec12 first_bus_u8_ps2tmoncrieff
 
17 btec12 first_bus_u8_ps3
17 btec12 first_bus_u8_ps317 btec12 first_bus_u8_ps3
17 btec12 first_bus_u8_ps3tmoncrieff
 
15 btec12 first_bus_u8_ps1
15 btec12 first_bus_u8_ps115 btec12 first_bus_u8_ps1
15 btec12 first_bus_u8_ps1tmoncrieff
 
04 btec12 first_bus_u3_pp1
04 btec12 first_bus_u3_pp104 btec12 first_bus_u3_pp1
04 btec12 first_bus_u3_pp1tmoncrieff
 

More from tmoncrieff (14)

Lesson 3-health-and-safety
Lesson 3-health-and-safetyLesson 3-health-and-safety
Lesson 3-health-and-safety
 
Lesson 2-human-computer
Lesson 2-human-computerLesson 2-human-computer
Lesson 2-human-computer
 
Lesson 4 binary numbers
Lesson 4   binary numbersLesson 4   binary numbers
Lesson 4 binary numbers
 
Lesson 1 inputs and outputs
Lesson 1   inputs and outputsLesson 1   inputs and outputs
Lesson 1 inputs and outputs
 
Lesson 4 binary numbers
Lesson 4   binary numbersLesson 4   binary numbers
Lesson 4 binary numbers
 
Lesson 3-health-and-safety
Lesson 3-health-and-safetyLesson 3-health-and-safety
Lesson 3-health-and-safety
 
Lesson 2-human-computer
Lesson 2-human-computerLesson 2-human-computer
Lesson 2-human-computer
 
Lesson 1 inputs and outputs
Lesson 1   inputs and outputsLesson 1   inputs and outputs
Lesson 1 inputs and outputs
 
Year 7 lesson 2 text and maths
Year 7 lesson 2   text and mathsYear 7 lesson 2   text and maths
Year 7 lesson 2 text and maths
 
Lesson 1 inputs and outputs
Lesson 1   inputs and outputsLesson 1   inputs and outputs
Lesson 1 inputs and outputs
 
16 btec12 first_bus_u8_ps2
16 btec12 first_bus_u8_ps216 btec12 first_bus_u8_ps2
16 btec12 first_bus_u8_ps2
 
17 btec12 first_bus_u8_ps3
17 btec12 first_bus_u8_ps317 btec12 first_bus_u8_ps3
17 btec12 first_bus_u8_ps3
 
15 btec12 first_bus_u8_ps1
15 btec12 first_bus_u8_ps115 btec12 first_bus_u8_ps1
15 btec12 first_bus_u8_ps1
 
04 btec12 first_bus_u3_pp1
04 btec12 first_bus_u3_pp104 btec12 first_bus_u3_pp1
04 btec12 first_bus_u3_pp1
 

Recently uploaded

Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991RKavithamani
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
PSYCHIATRIC History collection FORMAT.pptx
PSYCHIATRIC   History collection FORMAT.pptxPSYCHIATRIC   History collection FORMAT.pptx
PSYCHIATRIC History collection FORMAT.pptxPoojaSen20
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docxPoojaSen20
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Micromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersMicromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersChitralekhaTherkar
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 

Recently uploaded (20)

Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
PSYCHIATRIC History collection FORMAT.pptx
PSYCHIATRIC   History collection FORMAT.pptxPSYCHIATRIC   History collection FORMAT.pptx
PSYCHIATRIC History collection FORMAT.pptx
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docx
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Micromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersMicromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of Powders
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 

Learn Python IF statements to control program flow

  • 1.
  • 2. LEARNING OBJECTIVE  Learn to use IF statements to execute code under certain circumstances.
  • 3. LEARNING OUTCOMES  I understand the meaning of different Boolean conditions...  I can set up a condition using an if statement in Python...  I can set up more than one condition using an elif and else statement in Python...
  • 4. STARTER A boolean condition is one that can have only two values true or false. The boolean comparison operators are as follows: Learning outcomes:  I understand the meaning of different Boolean conditions...  I can set up a condition using an if statement in Python...  I can set up more than one condition using an elif and else statement in Python...
  • 5. MAIN TASK 1 Here we say if a condition is true or false Now have a go at completing Task 1 on Worksheet 5. Learning outcomes:  I understand the meaning of different Boolean conditions...  I can set up a condition using an if statement in Python...  I can set up more than one condition using an elif and else statement in Python...
  • 6. MINI PLENARY Task 2 on your worksheet requires you to explain what an IF statement does. Provide an example of an IF statement to back up your explanation. Learning outcomes:  I understand the meaning of different Boolean conditions...  I can set up a condition using an if statement in Python...  I can set up more than one condition using an elif and else statement in Python...
  • 7. MAIN TASK 2 You can tell the computer to do something different when the condition isn’t true using the else keyword: Now attempt Task 3 on Worksheet 5 Learning outcomes:  I understand the meaning of different Boolean conditions...  I can set up a condition using an if statement in Python...  I can set up more than one condition using an elif and else statement in Python...
  • 8. PLENARY You have 5 minutes to work out the pay for both workers. Learning outcomes:  I understand the meaning of different Boolean conditions...  I can set up a condition using an if statement in Python...  I can set up more than one condition using an elif and else statement in Python...