What is Python Variables and how to use it?
In Python, a variable is a symbolic name that references or points to a value. Variables are fundamental in programming because they allow you to store, modify, and retrieve data during the execution of a program. ### 1. **What is a Variable?** - A variable is a name given to a data value. In Python, you don't need to declare a variable before using it. You simply assign a value to a variable, and Python automatically determines the data type based on the value. - **Naming Conventions**: - Must start with a letter (a-z, A-Z) or an underscore (_). - Cannot start with a number. - Can contain letters, numbers, and underscores. - Python variables are case-sensitive (`myVar` and `myvar` are different variables). **Example**: ```python x = 10 name = "Alice" is_active = True ``` - Here, `x`, `name`, and `is_active` are variables that store different types of values. ### 2. **Variable Assignment** -