#solution to problem 3 from the programming problems after chapetr #3 on page 114 #Second version - function has only one parameter RATE = 0.8 def insurance(cost): #we will declare local variable res to hold the result #local variable res will be only availaible for use #in this specific function res = cost * RATE print(res) def main(): #slight modification #calculate insurance cost for 3 different people #input cost1=int(input("enter first replacement cost ")) cost2=int(input("enter second replacement cost ")) cost3=int(input("enter third replacement cost ")) #calling the function and printing results print("the insurance amount for first property is") insurance(cost1) print("the insurance amount for second property is") insurance(cost2) print("the insurance amount for third property is") insurance(cost3) #the function insurance was called 3 times #actual parameters #first call: cost1 #second call: cost2 #third call: cost3 main()