Python - Variable
🧠 Python Variables (in Python ) A variable is a name used to store data in memory. Creating a variable In Python, you don’t need to declare a type. x = 10 name = "Shivam" price = 99.5 👉 Python automatically understands the data type. 🔹 Rules for variable names ✔ Must start with a letter or _ ✔ Can contain letters, numbers, _ ❌ Cannot start with a number ❌ Cannot use keywords like if , for , class ✔ Valid age = 25 _user = "abc" total_amount = 100 ❌ Invalid 1name = "abc" # ❌ class = 10 # ❌ keyword 🔹 Assigning multiple variables a, b, c = 1, 2, 3 🔹 Changing value (dynamic typing) x = 10 x = "Hello" # type changed automatically 🔹 Check type x = 10 print(type(x)) # <class 'int'> 🔹 Variable types (basic) a = 10 # int b = 3.14 # float c = "Hello" # string d = True # boolean ⚠️ Common mistakes x = 10 print(X)...