Python Fundamentals: Character Set, Tokens, Variables & Data Types: quick revision, 17 bites

All 17 revision bites from this kit, free and with no sign-up.

Python Code = Character Set → Tokens → Statements

Every Python program is built from these 3 layers.

Python code is constructed hierarchically: the **character set** provides valid characters, **tokens** are the smallest meaningful units, and **statements** are built from tokens.

Takeaway. Mastering tokens is the key to understanding Python syntax.

What Is a Character Set?

Python only recognizes these characters.

Takeaway. Any character outside the Python character set is invalid in source code.

What Is a Token?

Tokens are Python's smallest meaningful units.

Takeaway. Every Python statement is a sequence of tokens.

Python Has 35 Keywords

35 reserved words you cannot use as names.

Python has exactly **35 keywords** — all lowercase except `False`, `True`, and `None`.

Takeaway. Using a keyword as a variable name causes a syntax error.

Keywords vs Identifiers

One is reserved, the other is yours to name.

Takeaway. Keywords are fixed; identifiers are user-defined and must follow naming rules.

Rules for Naming Identifiers

Break these rules and Python throws an error.

Takeaway. Valid identifiers: myVar, _count, Ab123. Invalid: 1var, my-var, for.

Identifiers Cannot Start with a Digit

1var is invalid — here's why.

Takeaway. Digits are allowed inside identifiers, just not as the first character.

What Is a Literal?

Literals are the fixed values in your code.

Takeaway. In `a = 10`, the value `10` is a numeric literal.

Three Types of Integer Literals

Python integers come in 3 flavors.

Takeaway. Integer literals can be written in decimal, octal, or hexadecimal notation.

What Is a Variable?

A variable is a labeled box in memory.

Think of a variable as a **container** with a **label** (the name) and **contents** (the value).

Takeaway. Variables let programs store, retrieve, and update data during execution.

How to Assign Values to Variables

Python creates variables on first assignment.

Takeaway. Python declares and initializes variables in a single assignment statement.

Multiple Assignments in One Line

Assign many variables in one statement.

Takeaway. Python supports chained and unpacked assignments for concise code.

Python Is Case-Sensitive

Name and name are two different variables.

Takeaway. Case-sensitivity is a common source of bugs for beginners.

What Is an Operator?

Operators act on operands to produce results.

Takeaway. Operators are the verbs of programming — they do things to values.

What Are Punctuators?

Punctuators structure your Python code.

Takeaway. Punctuators give structure to code — they don't perform operations.

Exam Tip: Valid vs Invalid Identifiers

Spot the invalid name in seconds.

Takeaway. Check the first character and keyword status — that catches most invalid identifiers.

Remember the 5 Token Types

KILOP — five tokens, one acronym.

Use **KILOP** to recall the 5 Python token types:

Takeaway. KILOP = Keywords, Identifiers, Literals, Operators, Punctuators.

Make your own

Your notes can be a kit like these

Every kit here was made from real study material. Point Veda at a chapter, a PDF, a photo or a link and get notes, flashcards, practice MCQs, games and a scored test — free to start, in more than 40 languages.

  • Chapter notes
  • Flashcards
  • Practice MCQs
  • Scored tests
  • Paper Solver

Get Veda free See what students get

Free to start · Android app and web · More than 40 languages