# 3.1 Variables आणि types

Source: https://ravindrabagale.com/mr/datascience/ch03-python-basics-for-data-work/3-1-variables-and-types.html
Language: mr (Marathi with English technical terms)

Variable मध्ये value ठेवतो. Text साठी str, पूर्ण संख्येसाठी int, दशांशासाठी float आणि हो/नाहीसाठी bool वापरतो.

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))

वाचायला सोपे messages तयार करण्यासाठी f-strings वापरा:

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

Python मधलं :, formatting international पद्धतीने हजारांचा separator लावतं. Report मध्ये लाखांच्या Indian format ची गरज असेल तर पुढे वेगळं formatting करावं लागतं. Class मध्ये :,.2f पुरेसं आहे.

रवींद्र बागले यांची tip

gmv = "125450" असं लिहिलं तर ती संख्या text होते. गणितासाठी quotes काढा आणि type() वापरून खात्री करा.
