ecs10-04-25

ecs10-04-25 - ECS 10: Basic Concepts of Computing Prof....

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

View Full Document Right Arrow Icon
1 1 ECS 10: Basic Concepts of Computing Prof. Michael Gertz gertz@cs.ucdavis.edu April 25, 2008 2 Announcements ± Assignment 3 will be posted in the next 36 hours ± Information about the assignment, including sample programs will be posted on assignments Web page ± Grades for midterm (multiple-choice MC, and programs PG) are online at MyUCDavis ± MC, 12%: median: 8 points (= B) out of 14 ± PG, 5%: median: 6 points (=B+) out of 8 ± Midterms will be returned in discussion sections ± Solutions are posted on class Web site
Background image of page 1

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

View Full DocumentRight Arrow Icon
2 3 In the previous lecture. .. ± Decision structures ± if <condition_1>: <block_1> elif <condition_2>: <block_2> ... else: <block_n> ± A condition is a Boolean expression that evaluates to either True or False (both are Boolean constants ) ± A condition can be composed of sub-conditions using Boolean operators and, or, and not. ± The block under one and only one of the if…elif…elif…else lines is executed. ± The else is optional . If the else is missing , possibly none of the blocks in the if ... will be done. 4 Conditions in if-statements ± if reply != "a" and reply != "b": print "Please answer a or b" ± if reply == "a" or reply == "b": print "Thank you!“ ± reply = "" # initialize with empty string while (reply != "a" and reply != "b"): reply = raw_input("Please answer a or b") <continue with normal program. ..>
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 11/16/2011 for the course ECS 40175 taught by Professor Amenta during the Spring '09 term at UC Davis.

Page1 / 9

ecs10-04-25 - ECS 10: Basic Concepts of Computing Prof....

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

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