Python for Data Analytics • Lesson 2
Variables & Naming Rules
Learn how Python stores information using variables, how values can be changed, and how to create valid and readable variable names.
0 of 8 concepts completed
Complete the activity and related MCQ to unlock the next concept.
What Is a Variable?
A variable is a name that refers to a value in a Python program. It lets you store information once and reuse it later by name.
Learn by Seeing
A name for a value
name = "Yogesh" age = 20
The name refers to a string; age refers to a whole number.
A variable is a label stuck to a value. Try editing the value:
Interactive Activity
What is a variable in Python?
Hint: Think of a label attached to a value.
Python Analyst Mindset
Variables are named memory
Analysts use variables to hold totals, clean field names and intermediate results. Naming them well is what makes a script readable six months later — both by you and by anyone else on the team.
Assign
Name a value with =.
Reuse
Use the name anywhere.
Reassign
Update values safely.
Name well
Descriptive names, valid syntax.
Frequently Asked Questions
Variables & Naming — FAQs
No. A single = assigns a value. Double == compares two values and returns True or False.
No. Names must start with a letter or underscore. Numbers can appear after the first character.
Yes. score and Score are two different variables.
A variable can only refer to one value at a time. Reassignment replaces the reference, so the old value is no longer stored under that name.
Lesson Summary
What you learned
Names that refer to values.
Connect a name to a value.
The latest assignment wins.
Letters, digits, underscores — no leading digit, no spaces, case-sensitive.