lec-11-20

lec-11-20 - 11/20/2009 Announcements One question did not...

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

View Full Document Right Arrow Icon
11/20/2009 1 ECS 10 11/18 Announcements ± One question did not get graded on the Scantrons. So 55 was the max score. ± We will re-scan them next week to fix this, and I’ll update the scores on SmartSite. ± No lecture next Wds. I will be in lab hours and we’ll do a little review project. try-except convert = True try: float(x) except except: convert = False if convert: # rest of program here conversionCheck.py ± This is how couldBeFloat() worked. ± Recall specifically: if cc.couldBeFloat(popStr): pop = float(popStr) else: print ‘Not a number!’ ± The expression cc.couldBeFloat(popStr) is a Boolean, True if conversion will work. Functions ± Today we look at how this bit of code got into a function that we can include in a module. ± Any program we write with functions could have been written without them. No new magic…. ± But - makes it easy to pass code around, extend the language. ± Also makes for neater programs.
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-11-20 - 11/20/2009 Announcements One question did not...

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