Python dir() function

The dir() function in Python returns all properties and methods of the specified object, without the values.

Syntax

Parameter

object: This parameter represents the object one wants to see the valid attributes.

Return

This function will return all the properties and methods, even built-in properties which are default for all objects.

Example 1

Output

Example 2

Output

 

Pin It on Pinterest

Share This