portfolio

Save all of your labs and homework with comments, this means making copies. For handing in multiple files: you can use zip to compress and archive, or you can drag a folder with the files into the Dropbox.

Integer division and modulus

conditional statements

Suppose you want to compute the shipping cost for a mail order catalogue. The rule is that if your total is less than $10, you add $2, for $10 but less than $20, you add $3 and for $20 or more, it is $4. How do we format the output for money?

The syntax for an if statement is:

  if <boolean expression>: 
      <block of statements>

indenting

Loops