Decisions In today’s lesson we will look at:

Slides:



Advertisements
Similar presentations
Test practice Multiplication. Multiplication 9x2.
Advertisements

Because Everyone Makes Decisions Developer Studio Topics and Demonstration Jeff Winters, Branch Technical Specialist.
Selection Sort
Noadswood Science,  To understand what strings are and how decisions are made Thursday, September 17, 2015.
AOIT Introduction to Programming Unit 4, Lesson 11 Documenting Bugs and Fixes Copyright © 2009–2012 National Academy Foundation. All rights reserved.
Python – Making Decisions Lecture 02. Control Structures A program that only has one flow is useful but limited. We can use if statements to make these.
Animal Rescue Lesson 3. What will you do in this lesson?
Exceptions Handling Exceptionally Sticky Problems.
Lesson 3-1 Example Example 2 Find the sum of 311 and 452 using expanded form. 1.Write the first number in expanded form
CSC 4630 Meeting 5 January 31, Next Time Enhance the steps that you used to clean the Moby Dick chapter to create a shell script that takes any.
Selection Sort Comparison Data Movement Sorted.
Selection Sort
Authorial notes From now on you’ll do these before class, after you’ve finished and posted the assignment and bring them with you to class to turn in.
The If Statement There are no switch statements in Python. You need to use just if statements. There are no switch statements in Python. You need to use.
3.1.3 Program Flow control Structured programming – SELECTION in greater detail.
Python: Selection Damian Gordon. Python: Selection We’ll consider two ways to do selection: The IF statement The CASE statement.
Chapter three Conditional Statements ©
CIT 590 Intro to Programming Files etc. Agenda Files Try catch except A module to read html off a remote website (only works sometimes)
Multiply By 2-Digit Numbers (B) Unit 2 Lesson 6. Objectives:
Machine Language Computer languages cannot be directly interpreted by the computer – they are not in binary. All commands need to be translated into binary.
In today’s lesson we will be looking at: what we mean by the software development lifecycle the phases in the lifecycle We will focus particularly on testing:
PYTHON PROGRAMMING Year 9. Objective and Outcome Teaching Objective Today we will look at conditional statements in order to understand how programs can.
Exceptions in Python Error Handling.
what is computer programming?
Python 23 Mr. Husch.
Python Lesson 12 Mr. Kalmes.
Working with Multiple Workbooks
Use of Java’s HashMap.
Do it now activity Last lesson we used Flowol to create a solution to a problem a computer could solve. Identify what each symbol does:
QUESTIONS ABOUT YOU SHOULD ASK.
Math October 25 N1 and N2.
Unit Organizer Template
The UK Tier 1 Entrepreneur Visa and the UK Representative of Overseas Business Visa - SmartMove2UK
Working with Multiple Workbooks
Algorithms Today we will look at: what the word algorithm means
For -G7 programing language Teacher / Shamsa Hassan Alhassouni.
Today’s lesson – Python next steps
Functions and Procedures
Random Numbers In today’s lesson we will look at:
Excel Formulas, Macros & More
قواعد الاختبارات التحصيلية
Escape sequences: Practice using the escape sequences on the code below to see what happens. Try this next code to help you understand the last two sequences.
Hello World! Syntax.
JavaScript.
Decision Structures Case Structures.
Three Special Structures – Case, Do While, and Do Until
Repetition In today’s lesson we will look at:
Working with Multiple Workbooks
Test. essai.
A more complex LP problem with What’sBest!
XML Parsing I have to analyze over 300 XML files. The xml2csy.py can’t be used to call multiple files at time as per our previous communication. I am thinking.
Lesson 12: more on Equations
Analyzing Sources Learning Scale © 2018 UCF.
Python Lesson’S 1 & 2 Mr. Kalmes.
Decisions In today’s lesson we will look at:
Introduction to Programming with Python
Comparing floating point numbers
Do it now – PAGE 10 You will find your do it now task in your workbook – look for the start button! Sunday, 28 April 2019.
A more complex LP problem
Topic: Loops Loops Idea While Loop Introduction to ranges For Loop
Chapter 3: Selection Structures: Making Decisions
Python 10 Mr. Husch.
Python 13 Mr. Husch.
Thing / Person:____________________ Dates:_________________
Decision-making processes
LANGUAGE EDUCATION.
What you need to do… Drag the pieces of code into the correct order like you can see in the EXAMPLE below. print ( “ int input ) = + Hello world chr ord.
Working with Multiple Workbooks

The Linux Command Line Chapter 5
Presentation transcript:

Decisions In today’s lesson we will look at: what we mean by a decision the sorts of decisions a program might need to take programming a decision in Python

Decisions We need to make decisions all the time – what time to get up, what to eat, how to start your essay, etc. In programming, the word decision has the same sort of meaning. Can you think of a program that does exactly the same thing every time? Most programs make some sort of decision

Decisions What sort of things will your program make decisions based on? Your program might need to react to: what the user does what happens in the program the values of particular variables an external factor, such as date or time

Programming Decisions Most programming languages – and even spreadsheets – use an if command to make a decision In Python, the format is: if [test condition]: [command] For example... if x > 10: print(“X is bigger than 10”)

Multiple Commands There is an expanded form of IF that allows you to do more than one thing: if a > b: a = a + b b = a – b a = a – b print(“Always done”)

Alternatives You can also use the ELSE command to give an alternative: if a > 10: print(“a is bigger than 10”) else: print(“a isn’t bigger than 10”) print(“Always done”)