cps6-110915Handout

cps6-110915Handout - else Making Decisions tools Boolean...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
CompSci 6 Introduction to Computer Science Sept. 15, 2011 Prof. Rodger Announcements • Read for next time Chap. 6 • Assignment 1 • Reading Quiz on Blackboard – Due before class next time • Today – Finish Classwork 5, Classwork 6 – APT - ReplaceFirstHalf Making Decisions Question ? True False Making Decisions in Python if condition1 : Block of code to do if condition is true elif condition2 : Block of code to do if condition1 false, condition2 is true else: Block of code to do if other conditions false • Can have many elifs, leave out elif, leave out
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: else Making Decisions tools Boolean values: True, False Boolean operators: and, or, not Relational operators: <, <=, >, >= Equality operators: ==, != Look at if examples: miscIf.py, javabat X Y X and Y X or Y True True True True True False False True False True False True False False False False More on lists range (1,11) Generates a list of numbers from 1 to 10 Example: for num in range(1,11): print num...
View Full Document

Page1 / 2

cps6-110915Handout - else Making Decisions tools Boolean...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online