🧠 Python Notes – Chapter 2: Variables, Data Types, Operators, and Input


📌 1) variables.py – Simple Variables & Arithmetic

📜 Code:

a = 12  # Integer value assigned to variable 'a'
b = 829  # Integer value assigned to variable 'b'

print(b / a)  # Division operator returns float (even if both operands are integers)

📝 Explanation:


📌 2) database.py – Common Data Types

📜 Code:

a = 8723  # Integer
b = 78076.3496346  # Float (decimal number)
c = True  # Boolean: Can only be True or False
d = "Prathamesh"  # String (text)
e = None  # Special null value in Python

print(d is e)  # Checks whether both variables refer to the same object (identity)

📝 Explanation: