Python Built-in Functions — Python Technical Interview Questions & Answers
Python Built-in Functions
Python Built-in Functions
- Built-in functions ship with Python. You call them without import: print, len, type, range, sum, min, max, sorted, enumerate, zip, input, int, str, list. They keep small scripts consistent. len(names) is the size. names.count("Asha") is how many times Asha appears — different job. Mixing len and count is a classic MCQ fail.
- Name eight you actually use. Don’t recite fifty. input() always returns text — wrap with int() if you need a number. sorted(a) returns a new list; a.sort() is a list method, not a built-in that returns the list.
- Python Built-in Functions — output: 3 60 30. Three builtins on one list.
def square(n):
return n * n
│ square(5)
▼
25Technical Interview Tip: len vs count — size vs how many times.
Code Examples for Python Built-in Functions
Example
# Built-in functions
nums = [10, 20, 30]
print(len(nums), sum(nums), max(nums))
Python Built-in Functions — output: 3 60 30. Three builtins on one list.
How to Explain Python Built-in Functions to an Interviewer
Explain Built-in Functions as if you are teaching a junior — definition, then one tiny script.
No import. print len type range. input() returns str.
What does the example print, and why?
Python Built-in Functions — output: 3 60 30
What mistake do freshers make with Built-in Functions?
len vs count. sorted vs sort.