Decision Making. Alter the flow of the program Conditionally controlling execution of a set of commands if -statement: if a > b: print a.

Slides:



Advertisements
Similar presentations
Line Efficiency     Percentage Month Today’s Date
Advertisements

Unit Number Oct 2011 Nov 2011 Dec 2011 Jan 2012 Feb 2012 Mar 2012 Apr 2012 May 2012 Jun 2012 Jul 2012 Aug 2012 Sep (3/4 Unit) 7 8 Units.
HOW TO MAKE A CLIMATE GRAPH CLIMATE GRAPHING ASSIGNMENT PT.2.
ProjectImpactResourcesDeadlineResourcesDeadline Forecast Plan Time Resources Risk 001xx 002xx 003xx 004xx 005xx 006xx 007xx TotalXX Example 1: Portfolio.
1 Upper Basin Snowpack as of 3/26/2014
Using the Trapezoidal Model to Derate NW Hydro Capacity Resource Adequacy Technical Committee July 25, 2007 Portland, Oregon.
Windows Server 2008 R2 Oct 2009 Windows Server 2003
Jan 2016 Solar Lunar Data.

The 6 steps of data collection:
Baltimore.
Q1 Jan Feb Mar ENTER TEXT HERE Notes

Project timeline # 3 Step # 3 is about x, y and z # 2
Average Monthly Temperature and Rainfall
ABT & Frequency.


Mammoth Caves National Park, Kentucky
2017 Jan Sun Mon Tue Wed Thu Fri Sat
Timeline PowerPoint Template

Gantt Chart Enter Year Here Activities Jan Feb Mar Apr May Jun Jul Aug
Q1 Q2 Q3 Q4 PRODUCT ROADMAP TITLE Roadmap Tagline MILESTONE MILESTONE
CORPUS CHRISTI CATHOLIC COLLEGE – GEOGRAPHY DEPARTMENT
Free PPT Diagrams : ALLPPT.com

FY 2019 Close Schedule Bi-Weekly Payroll governs close schedule

Wireless Local Number Portability Timeline - Phase 2
Step 3 Step 2 Step 1 Put your text here Put your text here
Calendar Year 2009 Insure Oklahoma Total & Projected Enrollment
MONTH CYCLE BEGINS CYCLE ENDS DUE TO FINANCE JUL /2/2015
Jan Sun Mon Tue Wed Thu Fri Sat
2009 TIMELINE PROJECT PLANNING 12 Months Example text Jan Feb March
HOW TO DRAW CLIMATE GRAPHS

©G Dear 2008 – Not to be sold/Free to use
Electricity Cost and Use – FY 2016 and FY 2017
A Climate Study of Daily Temperature Change From the Previous Day

Safety Group Program Timeline
©G Dear 2010 – Not to be sold/Free to use
Unemployment in Today’s Economy
Arrival Performance Acute Myocardial Infarction Patients Receiving Aspirin Within 24 Hours of Hospital Arrival Percent Jul-03.
Text for section 1 1 Text for section 2 2 Text for section 3 3
Text for section 1 1 Text for section 2 2 Text for section 3 3
Text for section 1 1 Text for section 2 2 Text for section 3 3
Text for section 1 1 Text for section 2 2 Text for section 3 3
Q1 Q2 Q3 Q4 PRODUCT ROADMAP TITLE Roadmap Tagline MILESTONE MILESTONE
Free PPT Diagrams : ALLPPT.com


Text for section 1 1 Text for section 2 2 Text for section 3 3
Text for section 1 1 Text for section 2 2 Text for section 3 3
Text for section 1 1 Text for section 2 2 Text for section 3 3
Text for section 1 1 Text for section 2 2 Text for section 3 3
Text for section 1 1 Text for section 2 2 Text for section 3 3
Text for section 1 1 Text for section 2 2 Text for section 3 3
Project timeline # 3 Step # 3 is about x, y and z # 2
TIMELINE NAME OF PROJECT Today 2016 Jan Feb Mar Apr May Jun
Safety Group Program Timeline
2012 Safety Group Advantage Program Timeline
2012 Safety Group Advantage Program Timeline
Wireless Local Number Portability Timeline - Phase 2

2009 TIMELINE PROJECT PLANNING 12 Months Example text Jan Feb March
2013 Safety Group Advantage Program Timeline
Q1 Q2 Q3 Q4 PRODUCT ROADMAP TITLE Roadmap Tagline MILESTONE MILESTONE
Pilot of revised survey
Presentation transcript:

Decision Making

Alter the flow of the program Conditionally controlling execution of a set of commands if -statement: if a > b: print a

if -Statement If the is True, then execute statements in the body of the if -statement If the is False, then the body is skipped over if : One-way Decision

if - else -Statement If the is True, then do commands specified in If the is False, then do commands specified in if : else: Two-way Decision Branching Two-way Decision Branching

if - elif - else -Statement if : elif : elif : … else: Multi-way Decision

Local Time Get local time and print out name of current month from time import localtime # get time yr, month, day, hr, mins, secs, wkdy, doy, dlght = localtime() if month == 1: print 'January' elif month == 2: print 'February' elif month == 3: print 'March'... else: print 'December'

Local Time Get local time and print out current month from time import localtime # get time yr, month, day, hr, mins, secs, wkdy, doy, dlght = localtime() months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] print months[month – 1]

Daylight Savings from time import localtime # get time yr, month, day, hr, mins, secs, wkdy, doy, dlght = localtime() if dlight: print 'Daylight Savings Time' else: print 'Not Daylight Savings Time'

Drawing a Histogram # File: histogram.py # Purpose: to generate a histogram # Author: # Required Libraries # Function: # Purpose: Create Window # Function: # Purpose: Draw and Label Axes (including Ticks) # Function: # Purpose: Draw a single bar # Function: # Purpose: Draw all bars # Function: # Purpose: Import raw data from a file # Function: # Purpose: Get Number of Bins from User