Built-in Functions
Table of contents
Description
Built-in functions are pre-installed with the Python language. They do not need to be imported or created by the programmer. Common built-in functions are print(), input(), and len()
- Python Docs: Built-in Functions
Invocation
When invoking (calling/executing) a function, you type it’s name followed by opening and closing parenthesis.
- Arguments: Some functions accept arguments (input), which are placed inside the parenthesis.
- Return Value: Some functions produce output, and return it to its caller.
Example
Line 1
- Function:
input - Argument(s):
'Hi! What\'s your name? ' - Return Value: User input
Line 2
- Function:
print - Argument(s): n-a
- Return Value: n-a
Line 3
- Function:
print - Argument(s):
f'Nice to meet you, {name.title()}.' - Return Value: n-a
Line 4
- Function:
len - Argument(s):
name(a variable) - Return Value: length of variable
Line 5
- Function:
print - Argument(s):
f'Your name has {characters} characters.' - Return Value: n-a