New course! Every coder should learn Generative AI!
Try a free lesson0
Dir() in Python
Can't understand what do dir(). Do u can explain it easily?
2 Answers
+ 1
Dir returns list of the attributes and methods of any object (say functions , modules, strings, lists, dictionaries etc.)
Try this:
import random
import math
print(dir())
0
Thx