Built-in Functions
メニューを表示するにはスワイプしてください
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.
すべて明確でしたか?
フィードバックありがとうございます!
セクション 4. 章 1
AIに質問する
AIに質問する
何でも質問するか、提案された質問の1つを試してチャットを始めてください
セクション 4. 章 1