When trying to program step 3, I programmed the solution using .get_rate, but wouldn’t accept the answer. When I looked at the solution the solution did not use .get_rate(). was the mistake the “.” that was placed before “get_rate()”?
Your method should not have a dot in the name…
My point exactly, but the instructions said to do it. It is very frustrating for a novice to understand what is being taught without the instructions being wrong.
For future reference, methods are attributes, and like all attributes, are called on the instance.
my_car = VehicleInsurance() my_car.get_rate()
That’s why we often see methods written in narratives with a leading dot. The dot tells us it is a method, and not a function. Perhaps that needs to be better explained early on in lessons about classes. At least now you know.
Thank you for explaining that. Now I have a better understanding. There is a lot to learn.