InterviewSolution
| 1. |
Does The Functions Help() And Dir() List The Names Of All The Built_in Functions And Variables? If No, How Would You List Them? |
|
Answer» No. Built-in functions such as max(), min(), filter(), map(), etc is not apparent IMMEDIATELY as they are available as part of standard MODULE.To VIEW them, we can pass the module ” builtins ” as an argument to “dir()”. It will display the built-in functions, exceptions, and other objects as a list.>>>dir(__builtins ) [‘ArithmeticError’, ‘AssertionError’, ‘AttributeError’, ……… ] No. Built-in functions such as max(), min(), filter(), map(), etc is not apparent immediately as they are available as part of standard module.To view them, we can pass the module ” builtins ” as an argument to “dir()”. It will display the built-in functions, exceptions, and other objects as a list.>>>dir(__builtins ) [‘ArithmeticError’, ‘AssertionError’, ‘AttributeError’, ……… ] |
|