I am doing a project on passing arguments through functions. My problem is that I am writing a program that gives the charged amount based on age and traffic violations. Here is my current code:
print("Use this program to estimate your liability.")
def main():
user_name()
age()
violations()
risk_code()
#Input#
#Def for name
def user_name():
user_name = print(input("What is your name?"))
#Def for age
def age():
age = int(input("What is your age?"))
#Def for traffic violations (tickets.)
def violations():
violation = print(input("How many traffic violations (tickets) do you have?"))
#Process#
def risk_code(violation):
if violation == 0 and age >= 25:
risk = "None"
cost = int(275)
#How many tickets to indicate risk code (therefore risk type)
# Age + traffic violations (tickets) = risk code
# Age + Traffic violations + Risk Code = Price
#Output#
#Def for customer name
# Def for risk output
# Def for cost
main()
I want the program to display how much the customer owes if I were to select my age as 25, with zero violations. The issue is I keep getting a positional argument error. I am a little confused on what this means. Could anyone provide help/example?