# ask user to enter item price
# until sentinel value is entered (less or equal zero)
while True:
price = input('Enter item price: ')
price = float(price)
# if price less or equal 0 - exit loop
if price <= 0:
break
# compute prices with discount for seven days
discount_price = price
for day in range(1, 8):
print(' day {0}, price: ${1:.2f}'.format(day, discount_price))
discount_price *= 0.9;
print() # empty line
Comments
Leave a comment