Variables and Assignment
Understand how variables work in Python and how to assign values.
Welcome to Variables
In Python, a variable is a named container that stores a value. You create one simply by assigning a value with =.
Your First Variable
Write: name = 'Alice' This stores the string 'Alice' under the label 'name'. Python infers the type automatically.
name = 'Alice'
print(name)All lessons in this course
- Variables and Assignment
- Numeric and Boolean Types
- Strings and Type Conversion
- Reading User Input