0
What is this code returning?
#please explain me this code and tell me the use of dir() keyword. def this_function_is_an_object(num): return "Cheese is {} times better than everything else".format(num) print(dir(this_function_is_an_object))
1 Answer
+ 3
Dir lists all the methods and variables available for that object .
Here "this_function_is_an_object" is an object of class "function".
đđ±đ¶đ: All those methods you see are of class " function" and base class "object" since function inherits the base class "object".