def changeRates(ans): while ans == "0": if ans == "0": print("which price bracket would you like to change?") print("0: Zero Violations") print("1: One Violations") print("2: Two Violations") print("3: Three Violations") print("4: Four or More Violations") print("5: Go Back") ans = input("") ans = inValid5.rangeValid(ans, 0, 5) if ans == 0: ans = (changeCost("zero")) elif ans == 1: ans = (changeCost("one")) elif ans == 2: ans = (changeCost("two")) elif ans == 3: ans = (changeCost("three")) elif ans == 4: ans = (changeCost("four")) elif ans == 5: return("0") return("quit")
def menu(choice): if choice == "0": print("Choose an option") print("1 = Run Program") print("2 = Admin") print("3 = Quit") choice = input("") choice = inValid5.rangeValid(choice, 1, 3) else: x = 2 if choice == 1 or choice == "1": return (main()) elif choice == 2 or choice == "2": return (calculations.adminMeta("0")) else: return ("quit")
def changeBreakpoint(): global breakPoint correct = False while correct == False: print("What would you like the break point to be?") print("Type \'back\' to go back") newBreak = str.lower(input("")) if newBreak == "back": return("0") else: newBreak = inValid5.rangeValid(newBreak, 16, 105) message = "You want to change the break point to " + str(format(newBreak, '.0f')) + " years old. Is this correct?" correct = input(message) correct = inValid5.boolValid(correct, "") if correct == True: breakPoint = newBreak print("The breakpoint is now", str(format(newBreak, '.0f')), "years old.") else: return("0")
def adminMenu(answer): if answer == "0": print("Which figures would you like to change?") print("1: The breakpoint age") print("2: The rates for young drivers") print("3: The rates for normal drivers") print("4: Go Back") answer = input("") answer = inValid5.rangeValid(answer, 1, 4) else: return("quit") if answer == 1: return(changeBreakpoint()) elif answer == 2: return(changeYoungRates("0")) elif answer == 3: return(changeRates("0")) elif answer == 4: return("quit") print("return 0") else: return("quit")
def getAge(): age = (input("Please input your age: ")) return (inValid5.rangeValid(age, 16, 105))