1
xkcd.com/518
1 Annoucnements Homework 1 due Wednesday 2 Survey of Computer - - PowerPoint PPT Presentation
xkcd.com/518 1 Annoucnements Homework 1 due Wednesday 2 Survey of Computer Science Decision Trees, Conditionals Kevin Walsh kwalsh@holycross.edu Readings: CSI 9.4, Py 1.6 Example Program >>> lbs = 5 lbs = 5 >>> kg =
1
xkcd.com/518
2
Annoucnements
Readings: CSI 9.4, Py 1.6
4
Example Program
5
A Subtle Distinction: Interactive vs. Script Mode
1.
2.
3.
1.
2.
6
Statements vs. Expressions
7
Statements vs. Expressions
8
Sequential Programming
9
Colossal Cave Adventure
You are in a low N/S passage at a hole in the floor. The hole goes down to an E/W passage. There are bars of silver here! > take silver OK > go south A little dwarf just walked around a corner, saw you, threw a little axe at you (which missed), cursed, and ran away. You're in Hall of Mt King. There is a little axe here. A cheerful little bird is sitting here singing. > take axe
10
Decision Trees
11
Conditional Statements
12
Conditions
13
Compound Statements
14
Control Flow
15
Multiple Decisions
16
Nested Conditional Example
17
Multiple Choices
18
Multiple Choices
19
Using if .. elif .. else
20
Using if .. elif .. else
21
Using if .. elif .. else
22
Practice Problem
23
The Decision Tree
24
The Python Code