Computer Science
Assertion. Python's built-in functions, which are part of the standard Python library, can directly be used without specifying their module name.
Reason. Python's standard library's built-in functions are made available by default in the namespace of a program.
Python Libraries
1 Like
Answer
(a)
Both Assertion and Reason are true and Reason is the correct explanation of Assertion.
Explanation
Python's built-in functions such as print()
, len()
, range()
etc, are automatically added to the program's namespace from the Python's standard library. They can be used directly without importing any modules or specifying their module name.
Answered By
1 Like
Related Questions
Assertion. After importing a module through import statement, all its function definitions, variables, constants etc. are made available in the program.
Reason. Imported module's definitions do not become part of the program's namespace if imported through an import <module> statement.
Assertion. If an item is imported through from <module> import <item> statement then you do not use the module name along with the imported item.
Reason. The from <module> import command modifies the namespace of the program and adds the imported item to it.
Assertion. Python offers two statements to import items into the current program : import and from <module> import, which work identically.
Reason. Both import and from <module> import bring the imported items into the current program.
What is the significance of Modules ?