Python Forum
sales per day for 5 stores
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
sales per day for 5 stores
#1
Task:
manager of 5 stores.

determine the sales of the individual stores was from the last day.

Write a program that asks how much money was available in the 5 stores at the beginning of the day and how much money was in the cash register at the end of the day.

Calculate how much sales each store has made and which of the 5 stores has achieved the highest or lowest sales.

print the information for each store and determine the store with the largest and smallest sales.

What i did:

while True:
try:
store1beginning = int(input("Please enter the amount of money you have in the morning in store 1: "))
break
except:
print("Sorry, that wasn't correct. Please try again by entering a number: ")

store2beginning = int(input("Please enter the amount of money you have in the morning in store 2: "))
store3beginning = int(input("Please enter the amount of money you have in the morning in store 3: "))
store4beginning = int(input("Please enter the amount of money you have in the morning in store 4: "))
store5beginning = int(input("Please enter the amount of money you have in the morning in store 5: "))


moneyinthemorning=['store1beginning','store2beginning','store3beginning','store4beginning','store5beginning']

while True:
try:
store1end = int(input("Please enter the amount of money you have at the end of the day in store 1: "))
break
except:
print("Sorry, that wasn't correct. Please try again by entering a number: ")

store2end = int(input("Please enter the amount of money you have at the end of the day in store 2: "))
store3end = int(input("Please enter the amount of money you have at the end of the day in store 3: "))
store4end = int(input("Please enter the amount of money you have at the end of the day in store 4: "))
store5end = int(input("Please enter the amount of money you have at the end of the day in store 5: "))

moneyintheevening=['store1end','store2end','store3end','store4end','store5end']

for number in moneyintheevening:
result = store1end - store1beginning
print("The sales in store 1 are",result)

but it doesn't work out and I don't get any further how i can calculate the other 4 stores and how to ssort them.
and how can i apply the try and except to all statements?
Reply
#2
First, please put your code in Python code tags, you can find help here.
This is required to make the code readable, especially because of indentation, which in Python is important.
Reply
#3
How can I edit a post?
Reply
#4
There should be an "edit" button next to the "like" button on the post toolbar. But maybe you can't see it yet as a new member. If that is the case, just make a new post with code in tags.
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020