Python Data Types Explained in Marathi

Python Data Types काय आहेत ?

Python Data Types म्हणजे variable मध्ये store होणाऱ्या values चा प्रकार.

उदाहरणार्थ—संख्या (Integer, Float), मजकूर (String), संग्रह (List, Tuple, Dictionary, Set) आणि logic values (Boolean).

Python मध्ये प्रत्येक variable ची value कोणत्या प्रकारची आहे हे data type ठरवते आणि त्यावर कोणते operations करता येतील तेही data type वर अवलंबून असते.

Python Data Types का महत्वाचे आहेत?

Python Data Types समजल्याशिवाय programming logic समजणे कठीण असते.

कारण data type ठरवतो:

  • Variable मध्ये कोणती value store होईल
  • कोणते operations करता येतील
  • memory कशी वापरली जाईल
  • error कसे टाळता येतील

Python मध्ये किती Data Types असतात?

Python मध्ये मुख्यतः 7 built-in data types वापरले जातात.

Python मध्ये किती Data Types असतात?
Data TypeDescriptionExample
Integerपूर्ण संख्या10
Floatदशांश संख्या3.14
StringText data“Python”
ListOrdered collection[1,2,3]
TupleImmutable collection(1,2,3)
DictionaryKey-value pair{“name”:”Rahul”}
SetUnique values{1,2,3}
BooleanTrue / FalseTrue

Python Data Types का महत्वाचे आहेत?

Python Data Types समजल्याशिवाय programming logic समजणे कठीण असते.

कारण data type ठरवतो:

  • Variable मध्ये कोणती value store होईल
  • कोणते operations करता येतील
  • memory कशी वापरली जाईल
  • error कसे टाळता येतील

Example:

Integer Data Type म्हणजे काय?

Integer (int) म्हणजे पूर्ण संख्या ज्यामध्ये decimal point नसतो.

Example:

Integer Features:

  • Positive and negative numbers
  • Unlimited-size integers
  • Mathematical operations support

Operation

  • Addition
  • Subtraction
  • Multiplication
  • / Division

Float Data Type म्हणजे काय?

Float” म्हणजे decimal values असलेली संख्या.

Example:

Float Use Cases

  • Scientific calculations
  • Money values
  • Measurements

String Data Type म्हणजे काय?

String म्हणजे text किंवा characters चा collection.

Example:

String Operations:

String Methods

Python List म्हणजे काय?

List म्हणजे ordered आणि mutable collection.

Example

List Features

  • Duplicate values allowed
  • Elements change करू शकतो
  • Indexing support

Common Methods

  • append()
  • remove()
  • insert()

Tuple Data Type म्हणजे काय?

Tuple म्हणजे immutable data collection. एकदा tuple तयार झाल्यावर त्यात बदल करता येत नाही.

Example: coordinates = (19.0760, 72.8777)

Tuple Advantages

  • Faster than list
  • Less memory usage
  • Secure data storage

Dictionary Data Type म्हणजे काय?

A dictionary is a key-value pair data structure.

Example:

Dictionary Features

  • Fast data lookup
  • Key unique aspects
  • Values कोणत्याही type च्या असू शकतात

Set Data Type म्हणजे काय?

Set म्हणजे unique values चा collection. Duplicate values are automatically removed. होता त.

Example:

numbers = {1,2,3,4,4,5}

Output:

{1,2,3,4,5}

Boolean Data Type म्हणजे काय?

Boolean data type मध्ये फक्त दोन values असतात

  • True
  • False

Example

Usage

  • Conditions
  • Loops
  • Decision-making

Python Data Types Practical Example

Student Management System

या example मध्ये multiple data types वापरले आहेत:

  • Integer
  • String
  • List
  • Tuple
  • Boolean
  • Dictionary

Python Data Types वापरताना Common Mistakes

1. String आणि Integer Mix करणे

Wrong:

Correct:

2. Float Precision Error

0.1 + 0.2 ≠ 0.3

Result

0.30000000000000004

Python Data Types – Key Takeaways

  • Python मध्ये multiple built-in data types आहेत.
  • Data type ठरवतो variable behavior
  • Lists mutable असतात
  • Tuples immutable असतात
  • Dictionaries fast lookup साठी वापरले जातात
  • Sets unique values साठी वापरले जातात

FAQ:

Python मध्ये किती data types आहेत?

Ans: Python मध्ये मुख्यतः 7 built-in data types वापरले जातात—Integer, Float, String, List, Tuple, Dictionary, आणि Set.

Python मध्ये “String” म्हणजे काय?

Ans: String म्हणजे characters चा collection जो text store करण्यासाठी वापरला जातो.

Scroll to Top