massalalar ishlSH
Published: 2023-01-28 13:45:57

#ornatilgam ma'lumotlar turlari 
#dasturlashda ma'lumot turlari muhim tushunchadir.
#ozgaruvchilar har hil turdagi ma'lumotlarni saqlashi munkin va har xil bajarish munkin.
#pyton dasturlash tilida quydagi malumot mavjud 

#text type - String 
#umeric tiypes - integer, float, complex
#sequnce types - list, tipe, range 
#mapping type - dict
#boolen tupe - booL 
#binary types - butes, butearriy, memoryview
#none type - Nonetype

#Misol uchun 
#x = "hello world" #-- #String 
#x = 20 -- int
#x = 20.5 -- float
#x = 1j -- complex
#x = ["aplle" "banan" "cherry"] -- list
#x = ("aplle" "banan" "cherry") -- tuple
#x = range(6) -- range
#x = {"Name", : "John","Age" : 36} -- dict
#x = {"Apple", " banana", "cherry"} -- set 
#x = frozenset({"apple", "banna", "cherry",})
#x = true 
# = b"hello" -- bytes 
#x = bytearray(5) -- bytearray 
#x = memoryview(bytes(5)) -- memoryview
#x = None -- nonetype 

# string mashq!
#x = "hello world"
#display x:
#print(x)

#display the data type of x:

#int ga mashq:
#print(type(x))

#int ga mashq!
#x = 20 
# = 25 
#c = x + y 
#z = c + x  
#e = z + c 


#display x: 
#print(e)

#display the data type of x: 
#print(type(e))

#float ga mash!
#x = 20.5 


#display x:
#print (x)


#display the type of x: 
#print 

#complex ga mashq!
#x = 1j

#dsplay x:
#print(x)

#display the of x:
#print(type(x))

#x = 9 + 8j 
#y = 10 + 4.5j
#print(type(x))
#print(type(y))
#print(type(z))

#print(type(x)
#print(type(y)
#print(type(z)


#list ga mashq!
#x = ["apple","banana","cherry"]

#display x:
#print(x[2])

#display the data of x: 
#print(type(x))

#my_list = ["jessa", "kelly", 20,35.75]
#print(my_list)
#print(type(my_list))




#type ga mashq!
#x = ("apple", "banana", "cherry")

#displaay x:
#print(x)

#displayga the data type of x: 
#print(type(x))

# my_tuple = (11, 24, 56, 88, 78)
# print(my_tuple[2:5])

# range ga mashq!
# x = range(6)

#dict ga mashq:
#x = {"name: john","age": 36}

# display x: 
# print(x)

# display the data type of x:
#print(type(x))

#set ga mashq!
#x = {"name", "banana", "cherry"}

#display x:
#print(x)

#display the data type of x:
#print(type(x))

#bool ga mashq!
#x = True

#display x:
#print(x)

#display the data type of x:
#print(type(x))

#bytes ga mashq!
#x = b"Hello"  

# display x: 
# print(x)

# display the data type of x:
# print(type(x))

# sample_set = {"yellow", "orenge", "black"}
# sample_list = ["blue", "green", "red"]
# sample_set.update(sample_list)
# print(sample_set)

# set1 = {10, 20, 30, 40, 50}
# set2 = {30, 40, 50, 60, 70}
# set1.update(set2)
# print(set1.union(set2))

# set1 = {10, 20, 30}
# set2 = {20, 40, 50}
# set1.difference_update(set2)
# print(set1)

#memoryview ga mashq!
# x = memoryview(byttes(5)) 

# #display x!
# print(x)

# #display the data type of x!
# print(type(x))

"""sample_set = {"Yellow","Orange","Black"}
sample_list = ["Blue","Green","Red"]
sample_set.update(sample_list)

print(sample_set)
#update problems

set1 = {10, 20, 30, 40, 50}
set2 = {30, 40, 50, 60, 70}

print(set1.union(set2))
#union problems

set1 = {10, 20, 30}
set2 = {20, 40, 50}
set1.difference_update(set2)
print(set1)"""

#ikkita ro'yhatni lug'atga aylantiring

#keys = ['Ten', 'Twenty', 'Thirty']
#values = [10, 20, 30]

#res_dict = dict(zip(keys, values))
#print(res_dict)

#None ga mashq!
#x = None

#display x:
#print(x)

#display the data type of x:
#print(type(x))

#Setting the Specific Data Type - Maxsus ma'lumotlar turini o'rnatish

#Agar siz ma'lumotlar turini belgilamoqchi bo'lsangiz, quyidagi

x = str("Hello world")
x = int(20)
x = float(20.5)
x = complex(1j)
x = list(("Apple", "Banana", "Cherry"))
x = tuple(("Apple", "Banana", "Cherry"))
x = range(6) -- range
x = dict(name = "John", age = 36)
x = set(("Apple", "Banana", "Cherry"))
x = frozenset(("Apple", "Banana", "Cherry"))
x = bool(5)
x = bytes(5)
x = bytearray(5)
x = memoryview(bytes(5))

#Pythonda uchta raqamli tur mavjud:

#integer - int - #bu butun sonlar uchun
#float - #bu kasr sonlar uchun ishlatiladi
#complex - #bu murakkab sonlar uchun ishlatiladi

#x = 1  # int
#y = 2.8 # float
#z = 1j #complex