Language
日本語
English

Caution

JavaScript is disabled in your browser.
This site uses JavaScript for features such as search.
For the best experience, please enable JavaScript before browsing this site.

  1. Home
  2. Python Dictionary

Python Dictionary Index

Beginners Guide: Overview, Features, and Learning PathAn overview of Python, its key features, how code is executed, and a recommended learning order for this dictionary.
[Setup] Python Development EnvironmentSteps for installing Python and setting up an execution environment.
Creating and Running .py FilesHow to write and run .py files.
len() / type() / id()Basic built-in functions for getting length, type, and ID.
print() / input() / repr()Output, input, and string representation.
int() / float() / str() / bool()Basic type conversion.
range() / enumerate() / zip()Generating sequences, adding indices, and parallel iteration.
map() / filter() / sorted()Transforming, filtering, and sorting iterables.
dir() / vars() / getattr()Inspecting and retrieving object attributes.
callable() / iter() / next()Checking callability and working with iterators.
open()Opening files using a context manager.
list.append() / list.extend() / list.insert()Appending elements to a list.
list.pop() / list.remove() / list.clear()Removing elements from a list.
list.index() / list.count() / in OperatorSearching for and checking elements in a list.
list.sort() / list.reverse() / list.copy()Sorting and copying lists.
list + list / list * n / SlicingConcatenating, repeating, and slicing lists.
List ComprehensionSyntax for generating a list in one line.
list() / tuple() / set()Converting between lists, tuples, and sets.
str.split() / str.join()Splitting and joining strings.
str.replace() / str.translate()Replacing substrings.
str.strip() / str.lstrip() / str.rstrip()Removing whitespace or specific characters.
str.upper() / str.lower() / str.title()Converting between uppercase and lowercase.
str.find() / str.index() / str.count()Searching for and counting substrings.
str.startswith() / str.endswith() / inChecking prefix, suffix, and containment.
str.format() / f-strings / str.zfill()Formatting strings.
dict.get() / dict.setdefault()Safe key retrieval and setting default values.
dict.keys() / dict.values() / dict.items()Retrieving keys, values, and key-value pairs.
dict.update() / dict.pop() / dict.clear()Updating and deleting dictionary entries.
dict.copy() / dict() / Dict MergeCopying, creating, and merging dictionaries.
Dict ComprehensionSyntax for generating a dictionary in one line.
set.add() / set.remove() / set.discard()Adding and removing elements from a set.
set.union() / set.intersection() / set.difference()Set operations: union, intersection, and difference.
set.issubset() / set.issuperset() / set.isdisjoint()Checking subset and superset relationships.
abs() / round() / divmod() / pow()Absolute value, rounding, divmod, and exponentiation.
math.sqrt() / math.ceil() / math.floor()Square root, ceiling, and floor functions.
math.pi / math.e / math.log() / math.sin()Mathematical constants, logarithms, and trigonometric functions.
random.random() / random.randint() / random.choice()Generating random numbers and making random selections.
open() / file.read() / file.write()Reading and writing text files.
os.path.join() / os.path.exists() / os.path.basename()Basic path operations.
os.listdir() / os.makedirs() / os.remove()Directory operations.
pathlib.Path()Modern path operations using pathlib.
re.match() / re.search() / re.fullmatch()Pattern matching with regular expressions.
re.findall() / re.finditer()Finding all matches of a pattern.
re.sub() / re.split() / re.compile()Substituting, splitting, and compiling regular expressions.
json.dumps() / json.loads()Converting between JSON strings and Python objects.
csv.reader() / csv.writer()Reading and writing CSV files.
datetime.datetime() / datetime.date() / datetime.time()Creating date and time objects.
datetime.strftime() / datetime.strptime()Formatting date and time values.
datetime.timedelta()Calculating time durations and adding or subtracting from dates.
sys.argv / sys.exit() / sys.pathCommand-line arguments, program exit, and path management.
os.environ / os.getenv()Getting and setting environment variables.
collections.Counter()Counting occurrences of elements.
collections.defaultdict()Dictionaries with default values.
collections.deque() / collections.OrderedDict()Double-ended queues and ordered dictionaries.
itertools.chain() / itertools.islice() / itertools.count()Chaining, slicing, and counting iterables.
itertools.product() / itertools.permutations() / itertools.combinations()Cartesian products, permutations, and combinations.
itertools.groupby() / itertools.starmap() / itertools.accumulate()Grouping and aggregating iterables.
functools.reduce() / functools.partial()Aggregating values and partial function application.
functools.lru_cache() / functools.wraps()Memoization and decorator utilities.
isinstance() / issubclass() / type()Determining variable types.
any() / all() / bool()Batch evaluation of boolean conditions.
try / except / else / finallyBasic syntax for exception handling.
Common Built-in ExceptionsBuilt-in exceptions such as ValueError, TypeError, and KeyError.
raise / Custom Exception ClassesRaising exceptions and defining custom exceptions.
class / __init__() / selfDefining classes and creating instances.
@property / @classmethod / @staticmethodProperties, class methods, and static methods.
Inheritance / super() / Multiple InheritanceInheritance and method overriding.
__len__() / __getitem__() / __iter__()Special (dunder) methods.
def Decorator / @ SyntaxDefining and using decorators.
yield / Generator FunctionsDefining and using generators.
lambda / Anonymous FunctionsDefining anonymous functions.
threading.Thread()Concurrent processing with threads.
multiprocessing.Process()Parallel processing with multiple processes.
asyncio / async / awaitBasics of asynchronous programming.
urllib.request.urlopen()Making HTTP requests with the standard library.
http.server.HTTPServer()Starting a simple HTTP server.
*args / **kwargs*args receives any number of positional arguments as a tuple; **kwargs receives keyword arguments as a dictionary.
Comment (#) / Docstring (""")Single-line comments use #; docstrings use triple quotes and are read by help() and documentation generators.
def (Function Definition)Defines functions with the def keyword; covers default values, keyword arguments, and positional/keyword-only parameters.
f-string (f-String Literals)String interpolation syntax introduced in Python 3.6; embeds variables and expressions directly inside strings.
for StatementIterates over each element of a sequence in order; any iterable value can be traversed.
global / nonlocalglobal allows modifying global variables inside a function; nonlocal modifies variables in an enclosing scope from a nested function.
if / elif / elseThe basic conditional branching syntax; indentation defines blocks and conditions are evaluated top to bottom.
import / from ... importimport loads a module; from ... import brings specific names into scope; as assigns an alias.
in Operator (Membership Test)A membership test operator that checks whether an object is contained in a collection.
is Operator (Identity Check)Checks object identity (same location in memory); also explains the difference from == (value equality).
match / case (Pattern Matching)Structural pattern matching syntax added in Python 3.10; branches based on the structure or content of a value.
Operators (Arithmetic / Comparison / Logical)The three basic operator types: arithmetic, comparison, and logical; also covers Python-specific syntax like chained comparisons.
pass / break / continuepass is a no-op placeholder; break immediately exits a loop; continue skips the rest of the current iteration.
return StatementReturns a value from a function to the caller; tuples allow returning multiple values; early return enables guard clauses.
Type Hints (Annotations)Annotates function arguments and return values with type information; not enforced at runtime but used by tools like mypy.
Walrus Operator (:=)An assignment expression operator added in Python 3.8; returns a value as an expression while simultaneously assigning to a variable.
while / do-while LoopsLoop constructs that repeat a block while a condition is true; while evaluates the condition first, do-while evaluates it after.
with Statement (Context Manager)Safely manages resources using a context manager; ensures post-processing even if an exception occurs.