I was taking the quiz in the Classes module of the Python course when I ran into this question:
What does the
hasattr() function call in the last line here evaluate to?
five = 5
five_holder = HoldsFive()
The correct answer is that it evaluates to True. However, I’m confused as to why "five is in quotes in hasattr() even though “five” in HoldsFive doesn’t. Does this mean that the variable is automatically interpreted as a string and I have to specify it when I reference it as an argument to a function?