π Built-in Functions
Built-in functions are functions already provided by Python.
We can use them directly without defining them.
Examples:
print("Hello")
len("Python")
type(10)
sum([1, 2, 3])
max(10, 20)π¨βπ» Custom Functions
Custom functions are functions created by the programmer using the def keyword.
def greet(name):
print("Hello", name)
greet("Codeveda")Here, greet() is a custom function.
βοΈ Difference
Built-in Functions π | Custom Functions π¨βπ» |
|---|---|
Already provided by Python | Created by the programmer |
No need to define them | Defined using |
Ready to use | Designed for a specific requirement |
|
|