Variables in Python are used to store data values. A variable is created the moment you assign a value to it. Python is dynamically typed, which means you don’t need to declare the type of a variable explicitly.
Syntax for Variable Assignment
Variable Naming Rules
-
Variable names can contain letters (a–z, A–Z), numbers (0–9), and underscores (_)
-
Variable names must start with a letter or an underscore
-
Variable names are case-sensitive (
Nameandnameare different)
Example
Note:
age and Age are treated as two different variables in Python because variable names are case-sensitive.
What’s Next?
This is Day 2 of Python Basics.
In the next post, we’ll cover operators, user input, and simple Python programs.
Make sure to bookmark this page and check back for the next lesson.
If this post helped you, share it with a friend who is starting to learn Python.
Learning is better when we grow together.
Thank you for reading!
Try the examples on your system and drop your questions or thoughts in the comments below.

Comments
Post a Comment