I did my code different to yours, instead of cost I used days.
if days >= 7:
return 40 * days - 50
I also tried cost = 40 * days and got the same response. I changed my approach and focused on days and left cost completely out of my code.
It worked and I added a print command at the end - print rental_car_cost(add any number here) to see if it actually did the calculations correctly. Of course I did first work out what the cost would be before hand on a piece of paper to make sure it actually did the calculations correctly.
I hoped this helped, being a beginner myself I know how frustrating it is to think outside the examples that are provided for us.