Ravindra BagaleCourses & study guides मराठी Track your progress

3. Python Basics for Data Work

Data Science

3.1 Variables and Types

city = "Pune"                 # str
orders_today = 212            # int
gmv = 1_25_450.75             # float (underscores OK in Python 3.6+)
is_festival = True            # bool
print(type(city), type(gmv))

f-strings build readable messages:

print(f"{city} GMV today: ₹{gmv:,.2f}")
# Pune GMV today: ₹125,450.75

Note: Python’s :, uses international thousands separators. For full Indian lakh format in reports you often format manually later; for class, :,.2f is fine.

Ravindra Bagale's Tip

If you write gmv = "125450" with quotes, Python stores it as text, not as a number. Then gmv + 100 gives a TypeError, and adding two such texts only joins them side by side. Keep numbers without quotes, and check with type(gmv) before you do any maths.