# name: Richard Weiss # date: 10-3-06 # description: examples from Chapter 2, # if and while ############################ # if statement total = input("enter total cost ") if total < 10.00: print "shipping is $", 2.00 # todo: add the rest of the code # for $10 - $20 it is $3.00 # for $20+ it is $4 ########################### # while loop count = 0 while count < 10: print count count = count + 1 ########################### # another while loop line = "xxxxxx" count = 0 while count < 5: print line count += 1 ########################## # compute average # get input from user: -1 to stop # accumulate the sum, # divide by the count