StudyToCert

All certifications / PCEP / Lessons

PCEP – Certified Entry-Level Python Programmer PCEP-30-02 · Domain 1: Computer programming and Python fundamentals

Variables and naming rules, reserved keywords and PEP 8 naming conventions

▶ Watch the overview video

Last reviewed September 30, 2026 · Leer en español

A variable is a name that refers to a value stored in memory. In Python you create a variable simply by assigning to it: age = 30. There is no separate declaration and no fixed type attached to the name; the value carries the type, and the same name can later refer to a value of a different type, so age = "thirty" is legal. Python is therefore called dynamically typed. Using a variable before anything has been assigned to it raises NameError.

Free account

Keep reading for free

Create a free StudyToCert account to read the rest of this lesson: 7 more sections, 6 key terms, a real-world example, an exam tip and self-check questions. Every lesson, lab and practice test is free with an account.

Sign up free Log in

Study PCEP for free
A week-by-week plan with every lesson, quizzes, checkpoint tests, a practice exam and hands-on labs.
Open the PCEP study plan