Values and Literals
Learn what Python values and literals are, including numbers, strings, booleans, and None.
Sounds useful?
Jump into the interactive version.
No setup. No account. Just Python.
Values and Literals
Learn what Python values and literals are, including numbers, strings, booleans, and None.
Jump into the interactive version.
No setup. No account. Just Python.
This Block introduces one of the first building blocks of Python: values written directly in code. You will learn what a value is, what makes something a literal, and how Python reads common literal forms like 42, 3.14, "hello", True, False, and None.
The focus is simple: look at small pieces of code, recognize the values inside them, and avoid the tiny syntax mistakes that beginners often run into. Quotes matter. Capital letters matter. And yes, "5" and 5 are not the same thing.
What you will learn:
None literalsTrue, False, and NoneBy the end, you will be able to read small Python snippets more clearly and choose the right literal form for the value you actually mean.
Ready to practice this in the browser?
> Play now