cps6-110915

# Cps6-110915 - • Can have many elifs leave out elif leave out else Making Decisions tools • Boolean values True False • Boolean operators and

This preview shows pages 1–6. Sign up to view the full content.

CompSci 6 Introduction to Computer Science Sept. 15, 2011 Prof. Rodger

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

View Full Document
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

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

View Full Document
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

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: • Can have many elifs, leave out elif, leave out 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

## This document was uploaded on 01/17/2012.

### Page1 / 6

Cps6-110915 - • Can have many elifs leave out elif leave out else Making Decisions tools • Boolean values True False • Boolean operators and

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

View Full Document
Ask a homework question - tutors are online