Understanding Python Variables
In Python, variables are created when you assign a value to them. Unlike statically typed languages like C++ or Java, Python dynamically infers the data type based on the value assigned.
Core Built-in Types:
int: Whole numbers (e.g.,10,-5)float: Decimal numbers (e.g.,3.14,0.001)str: Text surrounded by single or double quotesbool: Boolean truth values (TrueorFalse)list: Ordered, mutable collections of items
python Example
# Variables & Types Demo
age = 22 # Integer
price = 99.95 # Float
course_title = "Python" # String
is_active = True # Boolean
skills = ["Python", "SQL", "Git"] # List
print(type(age))
print(f"Course: {course_title}, Total Skills: {len(skills)}")