HELP

+1 moises garcia · February 19, 2015
 Write a program that will display the price of an item if the price is reduced by 5% each day of a sale.  Allow the user to enter the initial price, then display a series of messages of the form "On day X, the price is Y" where X is the day number and Y is the price on that day.  The sale will last 7 days.

CAN ANYONE HELP ME WITH THIS?

Post a Reply

Replies

Oldest  Newest  Rating
0 Bernard Pyc0d333 Parah · February 20, 2015
what have you done yourself so far.

you need to share your code so we that we can help you with how to improve it.
+2 Jacky L · February 20, 2015
Hint: -Reducing 5% of an item, you can use (price) - (price * 0.05)
-Use a while loop (day < 7) and an incrementation in that while loop so it terminates (day += 1)
-Never be afraid to start on the code, something is better than nothing and you don't learn without trying
0 Zac Smith · February 20, 2015
Here is my attempt at solving this problem ... I am sure it can be much simpler, but this does work. 

price = float(input('Enter the initial price: '))
day = 1
while day < 8:
price = price - (price*.05)
print('On day',day, 'the price is $',round(price,2))
day +=1
  • 1

Python

107,232 followers
About

This section is all about snakes! Just kidding.

Links
Moderators
Bucky Roberts Administrator