Hello everyone. I have just started programming and English is not my first language, so I am sorry for any possible mistake.
I was doing the exercise specified in the object, that stated " * Create a second function to calculate the difference between the insurance costs (given as inputs) of any two individuals and print a statement saying: "The difference in insurance cost is xxx dollars."
". Now, I am probably missing something about the previous lesson, but this is the best that I have managed to write down:
def calculate_insurance_cost(name,age,sex,bmi,num_of_children,smoker):
** estimated_cost=250age - 128sex + 370bmi + 425num_of_children + 24000*smoker - 12500**
** return estimated_cost, print(f"The estimated insurance cost for {name} is {estimated_cost} dollars.")**
maria_insurance_cost = calculate_insurance_cost(“Maria”,28,0,26.2,3,0)#this will be used as cost2
omar_insurance_cost = calculate_insurance_cost(“Omar”,35,1,22.2,0,1)#this will be used as cost1
** #Extra_difference in costs**
def difference_cost(cost1,cost2):
** return cost1-cost2, print(f"The difference in insurance cost is {cost1-cost2} dollars.")**
difference_cost(omar_insurance_cost,maria_insurance_cost)
I thought to use the variable in which I have previously stored the result of my previous function, but it doesn’t work.
Can someone help me?