Learn practical skills, build real-world projects, and advance your career

Aayush - MY Notebook

A Quick Tour of Variables and Data Types in Python

image.png

Storing information using variables

my_favorite_color = "Black"
my_favorite_color
'Black'

A variable is created using an assignment statement. It begins with the variable's name, followed by the assignment operator = followed by the value to be stored within the variable. Note that the assignment operator = is different from the equality comparison operator ==.

You can also assign values to multiple variables in a single statement by separating the variable names and values with commas.