E make your program test itself write readable code

Info iconThis preview shows page 1. Sign up to view the full content.

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

Unformatted text preview: program! 35 RECAP: Types, values, expressions • Example: the “+” operator works on: Numbers: Strings   Note: “+” does not work with numbers and strings together 36 12 13 ­09 ­10 RECAP: Types, values, expressions • The type() func3on tells you the type of the value • type() also works with en3re expressions (e.g., x+1) 37 help()  iteraAve help from the shell type your topic 38 Again… remember • Formal languages like Python are literal: you have to specify precisely what you want done   E.g.: if you want to update the value of ‘area’ aXer upda3ng the value of ‘width’, you must explicitly do so • Every expression and every command has a unique (unambiguous) meaning, which may or may not be what you would expect   Learn what each expression means by trying them out and also varying them a bit (to see what happens)   Tinker with Python! 39 13 13 ­09 ­10 Debugging • We all make mistakes… Syntac3c Errors •  Happen when you give Python inst...
View Full Document

This document was uploaded on 03/02/2014.

Ask a homework question - tutors are online