Python reference desk

Python glossary

Simple definitions and small examples for the words you will meet while coding.

Variable

Foundations

A named container that stores a value for later use.

score = 10

String

Foundations

Text data written inside quotation marks.

message = 'Hello'

Integer

Foundations

A whole number without a decimal point.

lives = 3

Boolean

Foundations

A value that is either True or False.

door_open = False

Condition

Decisions

An expression that evaluates to True or False and guides a decision.

if score >= 100:

Loop

Repetition

Code that repeats a sequence of instructions.

for item in items:

List

Collections

An ordered collection that can hold many values.

colors = ['red', 'green']

Function

Functions

Reusable code grouped under a name.

def greet(name):

Parameter

Functions

A value a function receives when it is called.

def greet(name):

Return

Functions

A statement that sends a value back from a function.

return total
Built with GenMB
Built with GenMB