from sys import exit package = input("What package have you subscribed to? ") package = package.lower() #why is this done? #use if statements to check if package was valid? (a, b, or c) hours = input("How many hours did you use? ") hours = float(hours) #why is this done? while hours < 0: print("Hours must be positive (or zero)") hours = float(input("How many hours did you use? ")) while not ('a' <= package and package <= 'c'): print("You did not type in a valid package.") package = input("What package have you subscribed to? ").lower() if package == 'a': base_charge = 9.95 additional_charge = 2 hours_paid_for = 10 elif package == 'b': base_charge = 13.95 additional_charge = 1 hours_paid_for = 20 elif package == 'c': base_charge = 19.95 #additional_charge = 0 #don't need because not used for package c below else: exit() if (package == 'a' or package == 'b') and hours >= hours_paid_for: total_charge = base_charge + (hours - hours_paid_for)*additional_charge else: total_charge = base_charge print(total_charge) #note that this doesn't exist for package c #print(hours_paid_for)