I am trying to put a loop in this python code. If the answer is yes…

Question Answered step-by-step I am trying to put a loop in this python code. If the answer is yes… I am trying to put a loop in this python code. If the answer is yes to “Please re-enter amounts?” it should prompt the user to reenter amountofgasUsed, milesDriven, milesperGallon and will print. If the choice is no it will print “Thank you for working”). This code must have if and else. Currently it just keeps looping the 3 indents under while true. I’m struggling with this loop. See below, thanks. name = input(“Enter name: “)while True:   amountofgasUsed = float(input(“Enter amount of gas used (gallons): “))   milesDriven = float(input(“Enter the number of miles driven: “))   milesperGallon = milesDriven / amountofgasUsedprint(“nName:”,name)print(“amount of gas used:”,amountofgasUsed,” gallons”)print(“number of miles driven:”,milesDriven,” miles”)print(“MPG:”,milesperGallon,”miles/gallon”)choice=’Y’choice=input(“Please re-enter amounts? “)if  choice== ‘Y’ or choice== ‘y’:      ‘break’       else:      print (“Thank you for driving!”) Computer Science Engineering & Technology Python Programming ENTD 200 Share QuestionEmailCopy link Comments (0)