This preview shows page 1. Sign up to view the full content.
Unformatted text preview: loat(input(msg)) print("Product is ", product) #any number you type in will give you zero, because zero times any number is zero #to fix it, use product = 1 instead of product = 0 fixed code: product = 1 msg = "Type a positive number, or zero to quit " number = float(input(msg)) while number > 0: product = product * number print("Product", product, "Number", number) number = float(input(msg)) print...
View
Full
Document
This note was uploaded on 02/19/2013 for the course CIS 122 taught by Professor Staff during the Winter '08 term at Oregon.
 Winter '08
 Staff
 Algorithms

Click to edit the document details