Are you allowed to use python lists?
If so this code can be reduced dramatically.
to keep the current format, you can put main into a loop similar to:
Change this for your needs
If so this code can be reduced dramatically.
to keep the current format, you can put main into a loop similar to:
def main(): no_good = True # Set to true to force first iteration max_value = 10.0 while no_good: input_string, mon, tue, wed, thu, fri, sat, sun = total_bottles_returned() bottles_mon, bottles_tue, bottles_wed, bottles_thur, bottles_fri, bottles_sat, bottles_sun = calculate_returned_bottles(mon, tue, wed, thu, fri, sat, sun) if calculate_final_bottle_price(bottles_mon, bottles_tue, bottles_wed, bottles_thur, bottles_fri ,bottles_sat, bottles_sun) <= max_value: no_good = FalseI don't know what constitutes OK (not stated), so used a max amount.
Change this for your needs