I am about 5 weeks in my very first programming class, and this is still a bit difficult for me. I was wondering if anyone could help me out.
I guess I can't seem to figure out what I am Doing wrong, after finishing the input commands for the 7 days, it just goes back to the first day. This is my first time posting here so I apologize if I put in almost all of the code, I am just doing it for reference to see if maybe its something above of below the while loops that is causing my program to repeat itself. Thanks for any help in advance!
keepgoing = "y"
while keepgoing == "y":
while True:
try:
sundaySales = int(input("Enter Sunday's total sales: $"))
except ValueError:
print("Sorry, I didn't understand that.")
continue
else:
break
while True:
try:
mondaySales = int(input("Enter Monday's total sales: $"))
except ValueError:
print("Sorry, I didn't understand that.")
continue
else:
break
while True:
try:
tuesdaySales = int(input("Enter Tuesday's total sales: $"))
except ValueError:
print("Sorry, I didn't understand that.")
continue
else:
break
while True:
try:
wednesdaySales = int(input("Enter Wednesday's total sales: $"))
except ValueError:
print("Sorry, I didn't understand that.")
continue
else:
break
while True:
try:
thursdaySales = int(input("Enter Thursday's total sales: $"))
except ValueError:
print("Sorry, I didn't understand that.")
continue
else:
break
while True:
try:
fridaySales = int(input("Enter Friday's total sales: $"))
except ValueError:
print("Sorry, I didn't understand that.")
continue
else:
break
while True:
try:
saturdaySales = int(input("Enter Saturday's total sales: $"))
except ValueError:
print("Sorry, I didn't understand that.")
continue
else:
return True
Size=7
Sales=[sundaySales, mondaySales, tuesdaySales, wednesdaySales, thursdaySales, fridaySales, saturdaySales]
totalWeeklySales = sundaySales+mondaySales+tuesdaySales+wednesdaySales+thursdaySales+fridaySales+saturdaySales
sentence = "This week's total sales are ${} ". format(totalWeeklySales)
print (sentence)
import totalOutcome
totalOutcome.totalOutcome(totalWeeklySales)
keepGoing = input("Do you want to run this again? (Enter y)= ")
if keepGoing != "y":
print ("Great job this week!")