Dir() in Python | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Dir() in Python

Can't understand what do dir(). Do u can explain it easily?

18th Jul 2019, 11:12 AM
Deprion
Deprion - avatar
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())
18th Jul 2019, 11:36 AM
Dejan Francuz🥇
Dejan Francuz🥇 - avatar
0
Thx
18th Jul 2019, 8:02 PM
Deprion
Deprion - avatar