Blue DiamondXD5,369 Points
i dont get it, is __int__, __float__, __init__, and__name__ names or variavles name or they have they own use??
Chris FreemanTreehouse Moderator 58,944 Points
Variable names with a double-underscore prefix and suffix are typically reserved for built-in Python object attributes and methods and each has a special purpose.
As mentioned in PEP 8:
__double_leading_and_trailing_underscore__: "magic" objects or attributes that live in user-controlled namespaces. E.g.
__file__. Never invent such names; only use them as documented.
As for your list:
__int__: name of class method called when class instance issued in an integer context
__float__: name of class method called when class instance issued in an float context
__init__: name of class method called to initialize a class instance after it has been created
__name__: an object attribute containing the string name of the object. see below
>>> def foo(): ... pass ... >>> foo <function foo at 0x7ffa6241ba60> >>> f = foo >>> f <function foo at 0x7ffa6241ba60> >>> f.__name__ 'foo'
Post back if you need more help. Good luck!!