Question: my python close runs in pycharm and python idle but when run in windows debug / python after putting in the number of traffic violations
my python close runs in pycharm and python idle but when run in windows debugpython after putting in the number of traffic violations it closes the program instead of showing the output. my code: "def getcustomerinfo:
# This function gets the customer's name, age, and number of traffic violations.
# It validates the input and returns the values.
name inputEnter the customer's name:
while True:
try:
age intinputEnter the customer's age:
if age or age :
printDrivers must be between and years of age."
else:
break
except ValueError:
printInvalid input. Please enter a valid age."
while True:
try:
violations intinputEnter the number of traffic violations:
if violations :
printViolations may not be less than
else:
break
except ValueError:
printInvalid input. Please enter a valid number of violations."
return name, age, violations
def calculateriskcodeviolations:
# This function calculates the risk code based on the number of traffic violations.
if violations :
return
elif violations or violations :
return
elif violations :
return
else:
return
def calculateinsurancequoteage riskcode, violations:
# This function calculates the insurance quote based on the customer's age and risk code.
if age :
if riskcode :
return
elif riskcode and violations :
return
elif riskcode and violations :
return
elif riskcode :
return
else:
return
else:
if riskcode :
return
elif riskcode and violations :
return
elif riskcode and violations :
return
elif riskcode :
return
else:
return
def displayquotename riskcode, quote:
# This function displays the insurance quote to the customer.
risktypes : "High", : "Moderate", : "Low", : No
printfname as a risktypesriskcode risk driver, your insurance will cost $quote:f
# Main program
name, age, violations getcustomerinfo
riskcode calculateriskcodeviolations
quote calculateinsurancequoteage riskcode, violations
displayquotename riskcode, quote
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
