Built-in Functions
Swipe to show menu
Python comes with dozens of built-in functions β no import needed. They help you transform, measure, or convert values in one line of code.
Functions are grouped by purpose: numbers, text, types, and collections.
Converting Data Types
These functions helps to convert between basic types:
int()β to integer;float()β to float;str()β to string;bool()β to boolean.
Useful when working with input, formatting, or expressions.
Working with Numbers
These help clean or adjust numeric values:
abs()β absolute value (removes minus sign);round()β rounds floats to nearest whole or to decimals.
Working with Strings
These are commonly used for cleaning and formatting text:
lower()β make all letters lowercase;upper()β make all letters uppercase;strip()β remove spaces at the beginning and end;replace()β replace part of a string with another;split()β turn a string into a list of words;join()β combine list items into one string.
Collection Inspection
These return information about a list, tuple, or other iterable:
len()β count items;max()β largest value;min()β smallest value;sum()β total of all numbers.
Collection Transformation
These are helpful when looping, combining, or transforming collections:
sorted()β returns sorted list;enumerate()β adds index numbers;zip()β pairs items from multiple lists;range()β creates a sequence of numbers;map()β applies a function to each item;filter()β keeps items that meet a condition.
Summary
- Python's built-in functions save you time and code;
- You can convert data, adjust text, transform collections, and get answers instantly;
- These tools become essential as you build more complex programs.
Everything was clear?
Thanks for your feedback!
SectionΒ 4. ChapterΒ 1
Ask AI
Ask AI
Ask anything or try one of the suggested questions to begin our chat
SectionΒ 4. ChapterΒ 1