Python — Command Reference
Python's most-used commands, built-in functions and methods — each with its syntax, an explanation, a runnable example and its real-world use. Pick a category, click a command, and try the example yourself.
9 categories · 45 commands
🖥️
Output & Input
Printing to the screen and taking input from the user.
print()input()f-string🔢
Numbers & Math
Numeric operations, rounding and math functions.
abs()round()min() / max()sum()+2✍️
String
Methods for changing, searching, splitting and formatting strings.
len()upper() / lower()strip()replace()+4📋
List
Working with ordered, mutable collections of data.
items []append()insert()remove() / pop()+3🗂️
Dictionary & Set
Key-value mappings (dict) and unique collections (set).
dictionary {}get()keys() / values() / items()set🔁
Condition & Loop
Decision-making (if) and repetition (for/while) structures.
if / elif / elseforrange()enumerate()+2🧩
Function
Defining and reusing your own commands.
def / returndefault parameter*args / **kwargslambda📁
File & Error
Reading/writing files and catching errors.
open() / withtry / exceptraise🔄
Type & Conversion
Converting between data types and type checking.
int() / float()str()type() / isinstance()bool() / True-False