dir function

While coding, use dir() function to return all available class' methods of the variable. The function expect variable and return a list of all available methods. This is particularly useful during online coding test.

Example 1:

head = ListNode()
print(dir(head))

dir() function is also able to accept the class name as the argument

print(dir(ListNode))
Previous
Next