Jan-16-2023, 09:33 PM
(This post was last modified: Jan-16-2023, 09:33 PM by deanhystad.)
Please post code, not sceeen-shots.
No idea. It does not do anything that has a lasting effect. The information in not used in any way, other than printing. My guess is dir() is being used for demonstrating what dir() does; return attribute names for the object. Maybe you are supposed to carefully scan the printed information and see that "name", "age" and "country" are attributes of "Child", but things added to dictionaries or tuples do not become attributes.
It is a dumb demonstration.
No idea. It does not do anything that has a lasting effect. The information in not used in any way, other than printing. My guess is dir() is being used for demonstrating what dir() does; return attribute names for the object. Maybe you are supposed to carefully scan the printed information and see that "name", "age" and "country" are attributes of "Child", but things added to dictionaries or tuples do not become attributes.
It is a dumb demonstration.