DEV Community

Kerimova_Manzura
Kerimova_Manzura

Posted on

Data type

dasturlashda ma'lumotlar turi muhim tushunchadir.o'zgaruvchilar har xil turdagi ma'lumotlarni saqlashi mumkin va har xil ishlari bajarishi mumkkin.Python tilida quyidagi ma'lumotlar bor:

Text type - String
umeric types - intejer , float , complex
Sequence types - list, tuple, range
Mapping type - dict
Set types - set frozenset
Boolean type - bool
Binary types - bytes, bytearray, memoryview
None type - NoneType

Misol uchun
x = "Hello world" #-- #String
x = 20 -- int
x = 20.5 -- float
x = 9j -- complex
x = ["Cabage","Potato", "tomato"] -- list
x = ("Apple", "Banana", "cherry") -- tuple
x = range(6) -- range
x = {"Name",: "Lora", "Age",: 25} -- dict
x = {"banana","apple", "cherry"} -- set
x = frozenset({"aplle", "banana","cherry"})
x = True
x = b"hi" -- bytes
x = bytearray(5) -- bytearray
x = memoryview(bytes(5)) -- memoryview
x = None -- Nonetype

Top comments (0)