Introduction to Python

Built-In Functions

Lesson 5: Functions in Python

What are Built-in Functions?

Python comes with a set of built-in functions that are always available — no import needed. These functions handle common tasks like getting input, printing output, converting data types, and working with collections.

A dashboard panel with labeled buttons for print, input, len, type, range, max, min, and round representing Python's built-in functions

Commonly Used Built-in Functions

Python Built-in Functions

FunctionDescriptionExample
print()Displays output to the consoleprint("Hello")
input()Gets text input from the username = input("Your name: ")
int()Converts a value to an integerint("25")
float()Converts a value to a floatfloat("3.14")
str()Converts a value to a stringstr(100)
len()Returns the length of a string or listlen("Hello")
type()Returns the data type of a valuetype(42)
round()Rounds a number to given decimal placesround(3.14159, 2)
abs()Returns the absolute valueabs(-10)
max()Returns the largest valuemax(3, 7, 2)
min()Returns the smallest valuemin(3, 7, 2)
range()Generates a sequence of numbersrange(1, 10)

Examples

# len() - string length name = "PictoBlox" print(len(name)) # 9 # max() and min() print(max(10, 5, 8)) # 10 print(min(10, 5, 8)) # 5 # round() print(round(3.14159, 2)) # 3.14 # abs() print(abs(-42)) # 42

Python console output showing the results of len, max, min, round, and abs built-in function calls
Built-in functions are the backbone of Python programming. Mastering them will make your code shorter, cleaner, and more efficient!

Subscribe to our newsletter.

Get updates to news and events.