Skip to main content
Python Learning

Python Dictionary

Beginner Python Glossary

Clear, plain-English definitions and small code examples for every core term used across the nine chapters.

Storing a value inside a named variable using the single equals sign (=) or a compound operator like +=.

Example
score = 100

Bitwise Operator

Python Operators

An operator (&, |, ^, ~, <<, >>) that works directly on the binary 0 and 1 bits of integer values.

Example
print(6 & 3)  # 2

Boolean (bool)

Python Booleans

A data type with only two possible values: True or False (always capitalized in Python).

Example
is_ready = True

Casting (Type Conversion)

Python Data Types

Explicitly converting a value from one data type to another using functions such as int(), float(), str(), or bool().

Example
age = int("16")

Human-readable note starting with # that Python completely ignores when running the program.

Example
# Explain why this line existsprint("Hi")

Complex Number

Python Numbers

A numeric type in Python written with a real part and an imaginary part marked by j.

Example
z = 2 + 3j

The category of a value that determines what operations are valid on it, such as str, int, float, or bool.

Example
print(type("Hello"))

Equality Operator (==)

Python Operators

A comparison operator that returns True when two values are equal and False otherwise.

Example
print(5 == 5)  # True

A formatted string prefixed with f that allows embedding variables and expressions inside curly braces {}.

Example
name = "Leo"print(f"Hi, {name}!")

Float (Floating-Point Number)

Python Numbers

A number containing a decimal point or written in scientific notation (e.g., 3.14 or 2.5e3).

Example
pi = 3.14

Floor Division (//)

Python Operators

An arithmetic operator that divides two numbers and rounds down to the nearest whole integer.

Example
print(17 // 5)  # 3

Global Variable

Python Variables

A variable created outside any function so it can be read throughout the program.

Example
course = "Python"

Identity Operator (is)

Python Operators

An operator (is, is not) checking whether two variables refer to the exact same object in memory.

Example
x = Noneprint(x is None)

Indentation

Python Syntax

Spaces at the start of a line (4 spaces by convention) used by Python to group statements inside blocks.

Example
if 5 > 2:    print("Yes")

The integer position of a character in a string (or item in a sequence), starting from 0 for the first item.

Example
word = "Python"print(word[0])  # P

Integer (int)

Python Numbers

A whole number—positive, negative, or zero—with no decimal point.

Example
count = -42

A built-in function that returns the number of characters in a string or items in a sequence.

Example
print(len("Python"))  # 6

Local Variable

Python Variables

A variable created inside a function that can only be accessed within that function.

Example
def greet():    msg = "Hello"    print(msg)

Logical Operator

Python Operators

Keywords (and, or, not) that combine or reverse boolean conditions.

Example
print(True and not False)

Membership Operator

Python Operators

Keywords (in, not in) that check whether a substring or element exists inside a sequence.

Example
print("Py" in "Python")

Modulus (%)

Python Operators

An arithmetic operator that returns the remainder left over after dividing two numbers.

Example
print(17 % 5)  # 2

Python's built-in output function for displaying text and numbers on screen, supporting sep and end options.

Example
print("A", "B", sep="-")

String (str)

Python Strings

An ordered sequence of characters enclosed in single, double, or triple quotation marks.

Example
title = "Python Basics"

The grammar rules of a programming language governing spelling, quotes, parentheses, and indentation.

Example
print("Valid syntax")

A built-in Python function that tells you the data type of any value or variable.

Example
print(type(3.5))  # <class 'float'>

A named location used to store a value in a Python program so it can be reused or changed later.

Example
name = "Python"