Python Reference
Reference pages for Python — syntax, parameters, return values and runnable examples.
All Python reference pages
dict.get()
dict.get(key, default=None) reads a value by key and returns a fallback instead of raising KeyError when the key is missing — the safe way to read a dictionary.
dict.items()
dict.items() returns a live view of a dictionary's (key, value) pairs — the cleanest way to iterate when your loop needs both the key and the value.
enumerate()
enumerate() wraps any iterable and yields (index, item) pairs, giving you a running count alongside each value. It is the Pythonic replacement for looping over range(len(...)) and indexing back in.
range()
range() produces a lazy, memory-efficient sequence of integers — the standard way to count in a Python loop. It never builds a list; it computes each value on demand from its start, stop and step.
str.replace()
str.replace() returns a new string with occurrences of a substring swapped for another. By default it replaces every match; a count argument caps how many are changed. The original string is never modified.
str.split()
str.split() breaks a string into a list of substrings around a separator. With no separator it splits on any run of whitespace and drops empty pieces; with one it cuts on that literal, and maxsplit caps how many cuts it makes.
This is the Python reference on XCODX. Each page documents one feature completely — the exact syntax, its parameters and return value, the gotchas that trip people up, and runnable examples you can edit right on the page.
The pages below are grouped so related topics stay together. Pick one to dive in, or run anything you find in the Python online compiler.
Frequently asked questions
Are these Python reference pages for Python 3?
What is the difference between a method and a built-in function?
text.split(), d.get()), while a built-in function takes the value as an argument (range(5), enumerate(items)). Both are documented here.