I have fixed my own problem but would really appreciate some insight to see if i am grasping the concept properly.
In my code i received a error that price was referenced before assignment when i used ==. But came out correct when only using the one =. why is this causing a error when == runs fine on the other lines? example below of the wrong answer.
def rental_car_cost(days): price == 40 * days: if days >= 7 : price -= 50 elif days >= 3 : price -=20 return price