Python Data Types
เคกाเคा เคाเคเคช เคिเคธी เคช्เคฐोเค्เคฐाเคฎ (เคเคฎเคคौเคฐ เคชเคฐ เคเค เคธॉเคซ्เคเคตेเคฏเคฐ) เคฎें เคเคชเคฏोเค เคिเคฏे เคाเคจे เคตाเคฒे เคกाเคा เคे เคช्เคฐเคाเคฐ เคो เคฆเคฐ्เคถाเคคे เคนैं। เคเคฆเคนाเคฐเคฃ เคे เคฒिเค เคฏเคฆि เคोเค เคธॉเคซ्เคเคตेเคฏเคฐ เคฏूเคเคฐ เคธे เคจाเคฎ เคเคจเคชुเค เคเคฐเคจे เคे เคฒिเค เคเคนเคคा เคนै เคคो เคฏूเคเคฐ เคा เคจाเคฎ เคเค เคธ्เค्เคฐिंเค เคाเคเคช เคा เคกाเคा เคนै เค ीเค เคเคธी เคช्เคฐเคाเคฐ เคฏूเคเคฐ เคा เคฎोเคฌाเคเคฒ เคจंเคฌเคฐ เคเค เคเคจ्เคिเคเคฐ เคाเคเคช เคा เคกाเคा เคนै।
Data types refer to the types of data used in a program (usually a software). For example, if a software asks the user to input a name, then the user's name is a string type of data, similarly the user's mobile number is an integer type of data.
Data in a Python program is represented by an object (a variable in other programming languages). Each object stored in memory has its own identity (id), type and value.
The type of any object can be known using Python's type() function. Like the id of the object, the type is also unchangeable.
On the basis of changing the value of objects, objects can be divided into two categories, Mutable and Immutable. Mutable objects can change their value after storing in the memory while the value of Immutable objects cannot be changed.
เคกाเคा เคाเคเคช เคो เคชाเคเคฅเคจ เคฎें เคชเคนเคฒे เคธे เคเคชเคฒเคฌ्เคง เคนै เคฌिเคฒ्เค-เคเคจ (built-in) เคกाเคा เคाเคเคช्เคธ เคเคนเคฒाเคคे เคนैं। เคกाเคा เคाเคเคช เคो เคฏूเคเคฐ (เคเคฎเคคौเคฐ เคชเคฐ เคช्เคฐोเค्เคฐाเคฎเคฐ ) เคฆ्เคตाเคฐा เคฌเคจाเคฏे เคाเคคे เคนैं เคฏूเคเคฐ-เคกिเคซाเคंเคก (user-defined) เคกाเคा เคाเคเคช เคเคนเคฒाเคคे เคนैं।
Data types that are already available in Python are called built-in data types. Data types that are created by the user (usually programmer) are called user-defined data types.
Built-in Data Types in Python
-
None Type : "NoneType"
เคชाเคฏเคฅเคจ เคฎें, NoneType เคเค เคกेเคा เคช्เคฐเคाเคฐ เคนै เคो เคिเคธी เคฎाเคจ เคी เค เคจुเคชเคธ्เคฅिเคคि เคो เคฆเคฐ्เคถाเคคा เคนै। เคเคธเคा เคเคชเคฏोเค เค เค्เคธเคฐ เคฏเคน เคंเคिเคค เคเคฐเคจे เคे เคฒिเค เคिเคฏा เคाเคคा เคนै เคि เคिเคธी เคตेเคฐिเคเคฌเคฒ เคฏा เคธเคฎीเคเคฐเคฃ เคा เคोเค เคธाเคฐ्เคฅเค เคฎूเคฒ्เคฏ เคจเคนीं เคนै।
(In Python, NoneType is a data type representing the absence of a value. It is often used to indicate that a variable or expression has no meaningful value.)
eg: age = None
-
Boolean Type : "bool"
เคชाเคฏเคฅเคจ เคฎें, เคฌूเคฒ เคกेเคा เคช्เคฐเคाเคฐ เคชाเคเคฅเคจ เคฎें เคชเคนเคฒे เคธे เคฎौเคूเคฆ เคนै เคो เคฌूเคฒिเคฏเคจ เคฎाเคจों เคा เคฆเคฐ्เคถाเคคा เคนै, เคो เคธเคนी เคฏा เคเคฒเคค เคนो เคธเคเคคा เคนै। เคฌूเคฒिเคฏเคจ्เคธ เคช्เคฐोเค्เคฐाเคฎिंเค เคฎें เคฎौเคฒिเค เคนैं เค्เคฏोंเคि เคเคจเคा เคเคชเคฏोเค เค เค्เคธเคฐ เคจिเคฐ्เคฃเคฏ เคฒेเคจे เคเคฐ เคช्เคฐोเค्เคฐाเคฎ เคे เคช्เคฐเคตाเคน เคो เคจिเคฏंเคค्เคฐिเคค เคเคฐเคจे เคे เคฒिเค เคिเคฏा เคाเคคा เคนै।
(In Python, bool is a built-in data type that represents boolean values, which can be either True or False. Booleans are fundamental in programming as they are often used for making decisions and controlling the flow of a program.) eg: True, False
- Numeric Type :
-
"int"
เคชाเคฏเคฅเคจ เคฎें, int เคเค เคกेเคा เคช्เคฐเคाเคฐ เคนै เคिเคธเคा เคเคชเคฏोเค เคชूเคฐ्เคฃांเคों เคो เคฆเคฐ्เคถाเคจे เคे เคฒिเค เคिเคฏा เคाเคคा เคนै, เคो เคฌिเคจा เคिเคธी เคฆเคถเคฎเคฒเคต เคฏा เคญिเคจ्เคจाเคค्เคฎเค เคญाเค เคे เคชूเคฐ्เคฃ เคธंเค्เคฏाเคँ เคนैं। เคชूเคฐ्เคฃांเค เคงเคจाเคค्เคฎเค, เคเคฃाเคค्เคฎเค เคฏा เคถूเคจ्เคฏ เคนो เคธเคเคคे เคนैं। เคเคช เคเคฃिเคคीเคฏ เคธंเคाเคฒเคจ เคเคฐเคจे เคเคฐ เค เคชเคจे เคชाเคฏเคฅเคจ เคช्เคฐोเค्เคฐाเคฎो เคฎें เคชूเคฐ्เคฃ เคธंเค्เคฏाเคं เคे เคธाเคฅ เคाเคฎ เคเคฐเคจे เคे เคฒिเค int เคช्เคฐเคाเคฐ เคा เคเคชเคฏोเค เคเคฐ เคธเคเคคे เคนैं।
(In Python, int is a data type used to represent integers, which are whole numbers without any decimal or fractional parts. Integers can be positive, negative, or zero. You can use the int type to perform mathematical operations and work with whole numbers in your Python programs.) eg- 5, 12, 0
-
"float"
เคเคธे เคธंเค्เคฏाเคँ เคिเคจเคฎे เคฆเคถเคฎเคฒเคต เคญाเค เคนो เคเคฐ Immutable eg- 5.5, 12.0
-
"complex"
เคเคธे เคธंเค्เคฏाเคँ เคिเคจเคฎे เคฆो เคฎाเคจ เคนोเคคे เคนैं, เคชเคนเคฒा เคตाเคธ्เคคเคตिเค เคญाเค เคนै เคो เคตैเคเคฒ्เคชिเค เคนोเคคा เคนै, เคเคฐ เคฆूเคธเคฐा เคाเคฒ्เคชเคจिเค เคญाเค เคนै เคเคฐ Immutable eg- 5j, 1.1 +3j
- Sequences Type :
-
"str"
เค เค्เค्เคทเคฐों เคा เคธเคฎूเคน เคเคฐ Immutable eg- 'hello', "5"
-
"list"
เคเค เคฎाเคจो เคा เคธเคฎूเคน เคเคฐ Mutable eg- [5, 8, 5]
-
"tuple"
เคเค เคฎाเคจो เคा เคธเคฎूเคน เคฒेเคिเคจ Immutable eg- (5, 8, 5)
- Set Type :
-
"set"
เคเค เคฎाเคจो เคा เคธเคฎूเคน เคฒेเคिเคจ เคฏूเคจिเค เคเคฐ Mutable eg- {5, 8}
-
"frozenset"
เคธेเค เคे เคธเคฎाเคจ เคฒेเคिเคจ Immutable
- Mapping Type :
-
"dict"
เคชेเคฏเคฐ्เคธ (เคोเฅे) เคฎें เคฎाเคจ เคธ्เคोเคฐ เคเคฐเคคा เคนै เคเคฐ Mutable eg- {"name" : "cat", "age" : 4}
Comments
Post a Comment