lec-10-5

lec-10-5 - Announcements Second program due tomorrow night....

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

View Full Document Right Arrow Icon
1 ECS 10 10/5 Announcements ± Second program due tomorrow night. ± If you want to run a program one line at a time, like I did at the end of class last time: This is called “stepping through” a program ± ± For Windows, see the PyScripter program on the Software page of the class Web site. You can install this, and one of the things it does is step through programs. Malformed if statements ± if name = “”: print “Welcome!” if answer == “” Uses = instead of == ± if answer == print “Welcome!” ± if answer == “”: print “Welcome!” Missing : No indentation Nested if statements if today == "y": if yesterday == "y": print "Doin' good!" else else: print "Try harder!" else: print "Try harder!" Boolean expressions today == “y” ± Values of Boolean expressions are either True or False ± Boolean is a new data type. ± We now have four data types (and four kinds of expressions): integer, floating point, string and Boolean. Boolean expressions ± Have value True or False ± Examples: today == “y” x<30 x < 30 2+2 == 4 2+2 <= 5 “cat” != “Cat”
Background image of page 1

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

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

This note was uploaded on 01/14/2010 for the course ECS 10 taught by Professor Amenta during the Spring '07 term at UC Davis.

Page1 / 3

lec-10-5 - Announcements Second program due tomorrow night....

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