PCEP-30-02 · Question #143
The print() function is an example of:
The correct answer is A. a Python built-in function. print() is a built-in function because it comes pre-installed with Python itself - no import required, and it's defined in Python's standard interpreter, not by the programmer. Option B is wrong because user-defined functions are created with the def keyword by the developer…
Question
Options
- Aa Python built-in function
- Ba user-defined function
- Can anonymous function
- Da Python output method
How the community answered
(26 responses)- A73% (19)
- B4% (1)
- C15% (4)
- D8% (2)
Explanation
print() is a built-in function because it comes pre-installed with Python itself - no import required, and it's defined in Python's standard interpreter, not by the programmer. Option B is wrong because user-defined functions are created with the def keyword by the developer writing the code. Option C is wrong because anonymous functions in Python are created with lambda and have no name. Option D is a tempting distractor - print() does produce output - but "output method" is not a Python concept; methods belong to objects (e.g., str.upper()), while print() is a standalone function.
Memory tip: Think "built-in = batteries included" - Python ships with print(), len(), range(), and ~70 others ready to use out of the box, no setup needed.
Community Discussion
No community discussion yet for this question.