PCEP-30-02 · Question #190
A built in function is a function which ...
The correct answer is B. comes with Python, and is an integral part of Python. Built-in functions are functions that come pre-packaged with Python itself - they are always available without any additional steps, making B correct. Examples include print(), len(), range(), and type(), which you can call immediately in any Python program. Why the distractors…
Question
Options
- Ais hidden from programmers.
- Bcomes with Python, and is an integral part of Python.
- Chas been placed within your code by another programmer.
- Dhas to be imported before use.
How the community answered
(22 responses)- A14% (3)
- B77% (17)
- C5% (1)
- D5% (1)
Explanation
Built-in functions are functions that come pre-packaged with Python itself - they are always available without any additional steps, making B correct. Examples include print(), len(), range(), and type(), which you can call immediately in any Python program.
Why the distractors are wrong:
- A is wrong because built-ins are fully visible and documented; they are not hidden - in fact, they are among the most well-known functions in Python.
- C describes a different concept: a function written by someone else and included in your codebase, which would just be a user-defined or third-party function.
- D describes a module or library function (like
math.sqrt()), which requires animportstatement - built-ins require no import at all.
Memory tip: Think "built-in = built into the language." If you've never written an import statement and a function still works, it's a built-in.
Community Discussion
No community discussion yet for this question.