lec-10-9

lec-10-9 - Upcoming Events Assignment due Tues night...

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

View Full Document Right Arrow Icon
1 ECS10 10/9 Upcoming Events ± Assignment due Tues night ± Midterm Friday ± Review in class on Wednesday BRING A SCANTRON 2000 FORM ± BRING A SCANTRON 2000 FORM ± You can buy them at the Bookstore ± Multiple choice and writing a program ± Sample midterm on Web site; answers Monday. Still crashes! ± The input to float() has to be a string that represents a float. ± The input to int() has to be a string that represents an integer float(“2.366”) # does not crash float(“12”) # does not crash float(“cow”) # crashes! int(“3.45”) # crashes! int(“”) # crashes! How to avoid crashing? reply = raw_input(“Enter rate: “) annualRate = float(reply) ± Only some strings can be converted ± Python has no built in way to check if the input string can be converted or not. ± There is a way to do it, but we haven’t learned the right parts of Python yet… Operators and Functions ± Some operators: x = 6 - 7 x = 8.0 / 3.44 print ‘Molly’ + ’,’ if (x < 20) and (x >= 10):
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.

Page1 / 3

lec-10-9 - Upcoming Events Assignment due Tues 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