What is the use of dir () function in Python?
In Python, the dir() function is used to return all the properties and methods within a specified object, without actually having the values. The dir() function shall return all the features and methods present, including the in-built properties, which are set as default for all the objects within.
Here’s a short example to demonstrate the dir() function in Python:
name = "John"
age = 36
country = "Norway"
['__doc__', '__module__', 'age', 'country', 'name']