son=int(input('KIRITING: '))
if son>=1 and son<=9:
for i in range(int(SON[0:son]),int(SON[(9-son):])+1):
for j in range(len(str(i))-1):
if int(str(i)[j])>=int(str(i)[j+1]):
break
if j==len(str(i))-2:
print(i)
break
NUMBER 2.
cars = {}
holat = True
while holat:
name = input("MOSHINA NOMINI KIRITING : ")
price = float(input(f"{name.title()}NING NARXINI KIRITING:($) "))
cars[name] = price
javob = input("YANA MASHINA KIRITISHNI XOXLAYSIZMI ha/yuq ")
if javob != "ha":
holat = False
for car, price in cars.items():
print(f"{car.title()} NING NARXI {price}$")
NUMBER 3.
compyuter=[]
for i in range(5):
compyuter.append({
'nomi':None,
'protsessor': "intel",
'xotirasi':None,
'korpusi':'metal',
'narxi':None,
'eneration':[ 'i3' , 'i5', 'i7' ,'i9' ]
})
print(compyuter)
for com in compyuter[:2]:
com['nomi']='hp'
com['xotirasi']='1 TR'
for com in compyuter[2:]:
com['nomi']='apple'
com['xotirasi']='2 TR'
for i in compyuter:
if i['nomi']=='apple':
i['narxi']='1500$'
else:
i['narxi'] = '1000$'
print(compyuter)
NUMBER 4.
Foydalanuvchilar = { 'shoxruh':
{'familiya': 'Nurillayev',
'tyil': 1998,
'malumot': 'oliy',
'tillar': ['python', 'c++','Vue-js','java-script']
},
'oybek':
{'familiya': 'KHushvaktov',
'tyil': 1997,
'malumot': "oliy",
'tillar': ['html', 'css', 'js','python']
},
'shahzod':
{'familiya': 'Samaridinov',
'tyil': 1995,
'malumot': "oliy",
'tillar': ['html', 'css', 'js','angular','react-js','vue-js']
}
}
for ism, source in Foydalanuvchilar.items():
print(f"{ism}ning ma'lumotlari")
print(f"Familiyasi: {source['familiya']}, tug'ilgan yili: {source['tyil']}")
for language in source['tillar']:
print(language.upper())
NUMBER 5.
def massiv(n,m):
arr=list(range(n,m))
return arr
kichik=int(input('1-sonni kiriting '))
katta=int(input('2-sonni kiriting'))
arr=[]
if kichikarr=massiv(kichik,katta)
elif kichik==katta:
print('Sonlar bir biriga teng')
else:
arr=massiv(katta,kichik)
if len(arr)!=0:
print(arr)
manfiy_juft=[i for i in arr if i<0 and i%2==0]
manfiy_juft = [i for i in arr if i < 0 and i % 2 == 0]
manfiy_toq = [i for i in arr if i < 0 and i % 2 != 0]
musbat_juft = [i for i in arr if i > 0 and i % 2 == 0]
musbat_toq = [i for i in arr if i > 0 and i % 2 != 0]
print(f"Manfiy juft sonlar {manfiy_juft}")
print(f"Manfiy toq sonlar {manfiy_toq}")
print(f"Musbat juft sonlar {musbat_juft}")
print(f"Musbat toq sonlar {musbat_toq}")