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))

15th Mar 2021, 8:11 AM
pratham jain
pratham jain - avatar
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".
15th Mar 2021, 8:33 AM
Abhay
Abhay - avatar