Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Question on dir() function
#2
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.
Reply


Messages In This Thread
Question on dir() function - by Soorya25 - Jan-16-2023, 11:55 AM
RE: Question on dir() function - by deanhystad - Jan-16-2023, 09:33 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Function not scriptable: Noob question kaega2 3 1,234 Aug-21-2022, 04:37 PM
Last Post: kaega2
  input function question barryjo 12 2,804 Jan-18-2022, 12:11 AM
Last Post: barryjo
  Question on None function in a machine learning algorithm Livingstone1337 1 2,381 Mar-17-2021, 10:12 PM
Last Post: supuflounder
  Question in python function problem saratha 1 1,492 Jul-08-2020, 04:56 PM
Last Post: jefsummers
  question about python3 print function jamie_01 5 2,716 May-25-2020, 09:58 AM
Last Post: pyzyx3qwerty
  Question about the groupby function new_to_python 7 3,314 Feb-09-2020, 07:52 AM
Last Post: perfringo
  Question about list and while function doug2019 6 2,805 Oct-12-2019, 03:07 AM
Last Post: doug2019
  Question on Join() function sduvvuri 2 2,795 Jun-02-2019, 03:55 PM
Last Post: perfringo
  question about list and remove function wmw12344 5 3,736 Mar-30-2018, 11:52 AM
Last Post: ljmetzger
  Basic input() function question rebubula76 2 3,275 Nov-27-2017, 08:12 AM
Last Post: buran

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020