Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def main():
- name = input("what's your name? ")
- violations = violation()
- age = userAge()
- if age < 25:
- if violations >= 4:
- riskCode = 1
- risk = 'high'
- InsurancePrice = '$480.00'
- elif violations == 3:
- riskCode = 2
- risk = 'moderate'
- InsurancePrice = '$450.00'
- elif violations == 2:
- riskCode = 2
- risk = 'moderate'
- InsurancePrice = '$405.00'
- elif violations == 1:
- riskCode = 3
- risk = 'low'
- InsurancePrice = '$380.00'
- elif violations == 0:
- riskCode = 4
- risk = 'no'
- InsurancePrice = '$325.00'
- else:
- if violations >= 4:
- riskCode = 1
- risk = 'high'
- InsurancePrice = '$410.00'
- elif violations == 3:
- riskCode = 2
- risk = 'moderate'
- InsurancePrice = '$390.00'
- elif violations == 2:
- riskCode = 2
- risk = 'moderate'
- InsurancePrice = '$365.00'
- elif violations == 1:
- riskCode = 3
- risk = 'low'
- InsurancePrice = '$315.00'
- elif violations == 0:
- riskCode = 4
- risk = 'no'
- InsurancePrice = '$275.00'
- print(name,InsurancePrice,riskCode,risk)
- def userAge():
- age = int(input("What is your age? "))
- return age
- def violation():
- violations = int(input("how many violations do you have? "))
- return violations
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement