Glossary

Short explanations of the terms used in our lessons. Go back to the lesson where a term first appears to read more. (10 terms)

D

data type

The kind of a value, such as int, float, str or bool. Check it with type().

First appears in: Python for Beginners, lesson 3 "Variables and data types"

dictionary

A value (dict) that maps keys to values, written like {"name": "Taro"}. Look up a value by its key.

First appears in: Python for Beginners, lesson 20 "Dictionary basics"

F

f-string

A string written as f"…{expression}…" that embeds the values of variables or expressions.

First appears in: Python for Beginners, lesson 6 "String methods and f-strings"

function

A named block of code. Define it with def; it takes arguments and returns a value with return.

First appears in: Python for Beginners, lesson 25 "Function basics (def, parameters, return values)"

I

index

The position of an item in a sequence. It starts at 0, and -1 means the last item.

First appears in: Python for Beginners, lesson 5 "String indexing and slicing"

L

list

A value that holds several values in order, written like [1, 2, 3]. You can add and change items later.

First appears in: Python for Beginners, lesson 16 "List basics"

S

slice

Taking part of a sequence with [start:stop]. The stop position is not included.

First appears in: Python for Beginners, lesson 5 "String indexing and slicing"

string

A sequence of characters (str), written in ' or " quotes.

First appears in: Python for Beginners, lesson 3 "Variables and data types"

T

type conversion

Changing a value into another data type, as int("3") turns a string into an integer.

First appears in: Python for Beginners, lesson 7 "input and type conversion"

V

variable

A name that holds a value so you can use it later, as in x = 10.

First appears in: Python for Beginners, lesson 3 "Variables and data types"