Print('S=',S,'mert kadrat')


Download 78 Kb.
Sana23.06.2022
Hajmi78 Kb.
#773076
Bog'liq
9-sinf amaliy ish Python misol va masalalar dasturlari 50579
ShOKIR OMMOLASHT, 3 Tema, логика ж, 10. MOODLE NIMA, 2 5251373937777972400, SO1MvzmyjVKGCMDJR8znc3qpNfrouQhudqsC9ANm, 3412114061, C , Baxram, Doc1, BORLAND C BUILDER 6 NING GRAFIK IMKONIYATLARI, informatika 10-sinf test 1-variant (2), kiril1, latin1

1. Darvozaning eni 4 metr, bo‘yi esa 3 metr, darvoza yuzasi (S)ni hisoblash dasturini tuzing, darvoza qirrasining uzunligi (P)ni hisoblash dasturini tuzing.
e=4 m b=3m
S=e*b
print('S=',S,'mert kadrat')
P=2*(e+b) print('P=',P,'metr')
2.Ikkita qayiq turg‘un suvda bir-biriga tomon 4 km/soat va 2 km/soat tezlik bilan suzmoqda. Ular orasidagi masofa 24 km bo‘lsa, ular qancha vaqtdan keyin uchrashadi? qancha vaqtdan keyin ular orasidagi masofa 12 km ni tashkil etadi?
v1=4 km/soat v2=2 km/soat S=24 km v=v1+v2
S=v*t. t=S/v. v=v1+v2
t=S/v
print('t=',t,’soat’)
S1=24-12=12 km S1=12 km
t1=S1/v print('t1=',t1,'soat’)
3.Doiraning radiusi 4 metrga teng (PI=3.14) doira yuzini hisoblang, aylana uzunligini hisoblang.
pi=3.14
s=pi*r*r r=4 metr
s=pi*r*r
print('s=',s,'metr kvadrat')
l=2*pi*r
l=2*pi*r print('l=',l,'metr')

Darvozaning eni va bo‘yi foydalanuvchi tomonidan kiritiladi darvoza yuzasini hisoblash dasturini tuzing, darvoza qirrasining uzunligini hisoblash dasturini tuzing.


a=int(input('Bo`yi = '))
b=int(input('Eni= '))
S=a*b
print('S=',S)
P=2*(a+b)
print('P=',P)
2.Quyidagi o‘zgaruvchilar turini aniqlang:
alfa = 8764; beta = ‘Lola’ son=30.2
alfa=8764
print(type(alfa))
beta='Lola'
print(type(beta))
son=39.2 print(type(son))
3. O‘zgaruvchi uchun qiymat kiritilganda, uning turini #aniqlovchi dastur tuzing.
a=input('a=') print(type(a))

31-dars mashqlari


1.Quyidagi o‘zgaruvchilar turini aniqlang:
alfa = 579413; beta = 'Aqlbek'; d = True;
s = 0; resp = ’d’; b = 100; max = False;
fc = ’True34’; t = 102.5; res = ’2500’;
a = ’-50’; b = 45.67 alfa=579413
3print(type(alfa))
x=input()
beta='Aqlbek'
print(type(beta))
x=input()
d=True
print(type(d))
x=input()
t=102.5
print(type(t))

2.Ikkita qayiq turg‘un suvda bir-biriga tomon a km/soat va b km/soat tezlik bilan suzmoqda. Ular orasidagi masofa S km bo‘lsa, ular qancha vaqtda uchrashadi? a va b foydalanuvchi tomonidan kiritiladi.


v1=int(input('birinchi qayiqning tezligi=')) v2=int(input('ikkinchi qayiqning tezligi='))
S=int(input('Oralaridagi masofa='))
v=v1+v2
S=v*t. t=S/v. v=v1+v2
t=S/v
print('t=',t,' soat')
3.Xonaning bo‘yi (x) va eni (y) metr #foydalanuvchi tomonidan kiritiladi.
Xonaning yuzasi (S) va perimetri (P)ni topish dasturini tuzing.
a=int(input('a='))
b=int(input('b='))
S=a*b
print('S=',S,'mert kadrat')
x=input()
P=2*(a+b)
print('P=',P,'metr')
6.Doiraning radiusi r ga teng. Doiraning yuzi (s) va aylana uzunligi
l ni topish dasturini tuzing. Doiraning radiusi foydalanuvchi tomonidan kiritiladi
(PI=3.14).
pi=3.14
s=pi*r*r
pi=3.14
r=int(input('r='))
s=pi*r*r
print('s=',s,'metr kvadrat')
l=2*pi*r
x=input()
l=2*pi*r
print('l=',l,'metr')
1.Berilgan a va b sonlari yig‘indisi, ko‘paytmasini toping. Yig‘indi va ko‘paytma oxirgi raqamlarining ko‘paytmasini topish dasturini tuzing.
33-dars masalalari
Berilgan Ifoda Natija
a = 8 d = a + b = 8 + 9 =17 S=7*2=14
b = 9 c = a * b = 8 * 9 = 72
a=8
b=9
d=a+b
print("d=",d)
c=a*b
print("c=",c)
x=d%10
print(x)
y=c%10
print(y)
S=x*y
print("S=",S)
2.Berilgan ikki xonali son xonalarining yig‘indisini hisoblash dasturini tuzing.
print("ikki xonali son kiriting")
x=int(input())
a=x//10
b=x%10
S=a+b
print("S=",S)
3.Quyidagi ifodani Python tilida yozing:
1) x + 2y + 52 * 4–58
x+2*y+(5**2)*4-58
2) 256+(2589–1549)*458+45614–4565/5
256+(2589-1549)*458+456**14-4565/5
35-dars masalalari
1.Hovuzning bo‘yi 6 metr, eni 4 metr va chuqurligi 3 metr.Berilganlar asosida
quyidagi topshiriqlar uchun dastur tuzing: a) Hovuz ichiga kafel qoplash uchun qancha kvadrat metr kafel kerak bo‘ladi? b) Hovuzni to‘ldirish uchun qancha litr suv kerak bo‘ladi (1 l = 1000 cm3)?
a=6 metr
b=4 metr
c=3 metr
s=a*b+2*b*c+2*a*c
print("Kafel qoplash uchun",s,"kvadrat metr maydon")
v=a*b*c
print("v=",v*1000,"litr")
2.Yuqoridagi masalada hovuz bo‘yi, eni va chuqurligi kattaliklari foydalanuvchi tomonidan kiritiladigan hol uchun dastur tuzing.
print("Hovuzning bo`yi a")
a=int(input())
print("hovuzning eni b")
b=int(input())
print("Hovuzning chuqurligi")
c=int(input())
s=a*b+2*b*c+2*a*c
print("Kafel bosiladigan yuza",s,"metr kvadrat")
v=a*b*c
print("Hovuzning hajmi",v*1000,"litr")
3.10 288 sekundni soat, minut va #sekundlarda ifodalang.
t=10288 #sekund
tm=t/60#minut
ts=tm/60#soat
print("t=",t,"sek=",tm,"min=",ts,"soat")
4.Berilgan ikki xonali son xonalarining ko‘paytmasini hisoblash dasturini tuzing.
a=int(input('a='))
b=a//10
c=a%10
kupaytma=b*c
print("kupaytma",kupaytma)
5.Berilgan uch xonali son xonalarining yig‘indisi va ko‘paytmasini hisoblash dasturini tuzing.
Berilgan Ifoda Natija
897 8+9+7 24
8*9*7 504
print("Uch xonali son kiriting")
a=int(input())
print(a)
br=a//100
print("birinchi raqam-",br)
iir=a//10
ir=iir%10
print("ikkinchi raqam",ir)
ur=a%10
print("uchinchi raqam",ur)
s=br+ir+ur
p=br*ir*ur
print("Raqamlar yig`indisi-",s)
print("Raqamlar ko``paytmasi-",p)
6.Qisqartirilgan amallarni qo‘llagan holda, quyidagi dastur natijasini chiqaring.
Berilgan Ifoda Natija
a=8 a=int(input())
b=5 b=int(input())
c=9 c=int(input())
a-=b
a*=c
a+=(b*c+b)
print(a)
print('Butun a ni kiriting') a=int(input())
print('Butun b ni kiriting') b=int(input())
print('Butun c ni kiriting') c=int(input())
a-=b
print(a)
a*=c
print(a) a+=(b*c+b)
7. Quyidagi ifodani Python tilida yozing:
y=7
x2+x+1+x2
y=7/(x*x+x+1)+x*x
37.1-topshiriq
1. “GULTOJIXO‘ROZ” so‘zidan qism so‘zlar #ajratuvchi dastur tuzing. a='GULTOJIXO`ROZ'
b=a[:3]
print(b)
c=a[3:7]
print(c)
d=a[7:13]
print(d)
input()
37.2-topshiriq
2.TUZAMAN, PYTHON, DASTUR, TILIDA, MEN. Ushbu so‘zlardan jumla tuzuvchi dastur tuzing.
A='TUZAMAN'
B='PYTHON '
C='DASTUR '
D='TILIDA '
E='MEN '
P=E+B+D+C+A
print(P) input()

37.3-topshiriq


3.Foydalanuvchi tomonidan kiritilgan matn uzunligini aniqlovchi dastur tuzing.
print('Matn kiriting') a=str(input())
print("siz kritgan matnda ",len(a),'ta belgi bor.') input()
37.4-topshiriq
“*” lar yordamida uchburchak yasang.
print(' * ') print(' * * ') print(' * * * ') print('* * * *') input()
37.5-topshiriq
“+”yordamida kvadrat yasang. print('+ '*4)
print('+ '*4)
print('+ '*4)
print('+ '*4)
input()
37.6-topshiriq
Belgilar yordamida pingvin yasang.
print(" ~ ") print(" - - ") print(" (o o) ") print(" / V \ ") print(" /(_)\ ") print(" ^^ ^^ ")
38-dars 1-uy vazifasi
1.Kutubxonaga ikkita kitob do‘konidan kitoblar keltirildi.
Birinchi do‘kondan n dona kitob keltirildi. Ikkinchi do‘kondan esa birinchi do‘konga qaraganda k dona ko‘p kitob keltirildi. Kutubxonaga jami qancha kitob keltirildi? Masalani yechish
dasturini tuzing. n va k kattaliklar foydalanuvchi tomonidan kiritiladi.

print('Birinchi do`kondan keltirilgan kitoblar soni n ni kiriting/') n=int(input())


print('Ikinchi do`kondan keltirilgan ortiqcha kitoblar soni k ni kiriting/') k=int(input())
J=n+n+k
print('Jami kitoblar soni ',J,'ta') input()
38-dars 2-uy vazifasi
2.Komilaga 854*89657*4587*425 amalini dasturga kiritib, hisoblash topshirig‘i berildi. U qanday dastur tuzishi lozim?
s=854*89657*4587*425
print('s=',s)

9-sinf IAT 41.1


1. Tomoni a ga teng kvadrat ichiga doira chizilgan. Bo‘yalgan soha yuzi s ni topish dasturini tuzing.
from math import* PI=3.14
print('kvadrat tomoni uzunligini kiriting') a=float(input())
skv=pow(a,2)
sd=PI*pow((a/2),2)
s=skv-sd
print(s) input()

9-sinf IAT 41.2


2.Foydalanuvchi tomonidan kiritilgan sondan avval va keyin keluvchi sonni ekranga chiqaruvchi dastur tuzing.
print('a butun son kiriting') a=int(input())
b=a-1
c=a+1
print(b,':',c) input()

9-sinf IAT 41.3


3.n nafar o‘quvchi k dona olma terdi va olmalar ular o‘rtasida teng taqsimlandi. Qoldiq olmalar savatchaga solindi.
a) Har bir o‘quvchi qanchadan olma olgan?
b) Savatchaga qancha olma solingan?
n va k kattaliklar foydalanuvchi tomonidan kiritiladigan hol uchun dastur tuzing.
print('n ni kiriting') n=int(input()) print('k ni kiriting') k=int(input()) t=n//k q=n%k
print(t,q)
input()

9-sinf IAT 41.4


4.Foydalanuvchi tomonidan kiritilgan ikki xonalidan katta natural sonning oxirgi ikki raqamini topish dasturini tuzing.
print('99< a son kiriting')
a=int(input())
q=a%100
print(q) input()

9-sinf IAT 41.5


5.Avtobus bir kunda n kilometr yo‘l yuradi. m kilometr masofani bosib o‘tishi uchun avtobus necha kun yurishi kerak? n va m kattaliklar foydalanuvchi tomonidan kiritiladi. Masalani yechish dasturini tuzing.
print('n ni kiriting') n=int(input()) print('m ni kiriting') m=int(input()) kun=m//n print(kun)

6.Chumolining bosib o‘tgan yo‘li millimetrlarda berilgan. Uni metr, santimetr va millimetrlarda ifodalang (masalan, 45 786 = 45 metr 78 cm 6 mm).


input()
m=45786
mm=m%10 sm1=m%1000 sm=sm1//10 me=m//1000
print(me,'metr',sm,'sm',mm,'mm') input()

9-sinf IAT 41.7


7.Kubning tomoni a ga teng. Kubning hajmini #topish dasturini tuzing.
print("kub qirrasi uzunligi a ni kiriting") a=float(input())
V=a**3 print(V)
input()
9-sinf IAT 41.8
8. a, b, c, d sonlari berilgan. Ularning o‘rta arifmetigini topish dasturini tuzing. print(' to`rtta son kiriting')
a=input().split()
a1=float(a[0])
a2=float(a[1])
a3=float(a[2])
a4=float(a[3])
ar=float((a1+a2+a3+a4))/4
print(ar) input()
42-DARS
1.Quyidagi mantiqiy ifodalar natijasini yozing:
print((3 > 5) and (2 > 4))
input()
print((2 < 5) and (3 > 0))
input()
print((4 > 2) or (4 < 1))
input()
print((3 > 1) or (5 > 0))
input()
2.Quyidagi mantiqiy ifodalar natijasini toping:
a

  1. = 20

  2. = 28

print(a>17 and b==28) input()
b

  1. = 20

  2. = 28

c=True
print(a>17 and b>22 and c)
44-DARS
1.Mantiqiy ifodalar qiymatini aniqlash uchun #dastur tuzing va natijasini oling:
a=8
b=a**3 print(aa=10
b=a*3 print(a<=b/3) input()
a=8
b=a c=(a+b==2*b) print(c)
input()
a=8
b=a-4 print((a+3)>=(b-2)) input()
3.Mantiqiy ifodalar natijasini toping:
a = 20
c = False d=a > 17 or c print(d)
input()
a = 20
c = False
d=not a > 17 or not c print(d)

2.Mantiqiy ifodalar qiymatini aniqlang:


a=(1 > 3) or (4 < 0)
b=not (5 > 6) print(b)
c=not (6 > 5) print(c)
d=(2 == 0) or (2 != 2) print(d)
e=(2 == 0) and (2 > 0) print(e)
f=(3 > 0) or (2 > 0) print(f)
a = True
b = True c = False
d=(not(a and c) and (a or b) or c)
print(d)
a = 66
b = 22
c = 7
d=not((a > b) or (b < c)) print(d)
4.Mantiqiy ifodalar qiymatini aniqlash uchun dastur tuzing va natijasini oling
a=int(input("a="))
b=(a<=5 or a>=0 and a<3) print(b)
input()
a=int(input("a=")) b=int(input("b=")) c=int(input("c=")) x=int(input("x=")) y=int(input("y="))
d=(x**2+y>0 and a==0.1 or (b>3.7 and c!=4))
print(d)
input()
a=int(input("a="))
b=int(input("b="))
s=(a<1 or a>0 or not (x*x+x*x<=1))
print(s)
input()
d=not(not(not(a>b) or True) and False) print(d)
46-DARS
1.Ikkita a va b son berilgan. Agar b son a sondan kichik bo‘lsa, u holda b ni nol bilan almashtiruvchi aks holda b ni o‘zgarishsiz qoldiruvchi dastur tuzing.

46-dars
1-topshiriq a=int(input('a=')) b=int(input('b=')) if a
b=0
print('b=',b) input()
46-dars 2-topshiriq
2.Berilgan a butun son noldan farqli b butun songa qoldiqsiz bo‘linishi yoki bo‘linmasligini aniqlovchi dastur tuzing.
a=int(input('a='))
b=int(input('b='))
c=a%b
if c==0:
print(a, ' soni', b, ' soniga qoldiqsiz bo`linadi')
else:
print(a, ' soni', b, ' soniga qoldiqsiz bo`linmaydi') input()
46-dars 3-topshiriq
3.Berilgan a butun son noldan farqli b butun songa qoldiqsiz bo‘linsa, bu ikkala sonning yig‘indisini, aks holda ko‘paytmasini topish dasturini tuzing.
a=int(input('a=')) b=int(input('b=')) c=a%b
if c==0: d=a+b
else: d=a*b
print(d) input()

46-dars 4-topshiriq


4.Uchta a, b va c son berilgan. Agar a2 – b2 = c2 shart bajarilsa, ularning ko‘paytmasini, aks holda yig‘indisini hisoblovchi dastur tuzing.
a=int(input('a=')) b=int(input('b=')) c=int(input('c='))
if a*a-b*b==c*c:
p=a*b*c print(p) else:
s=a+b+c print(s) input()

46-dars 5-topshiriq


5.Butun son berilgan. Agar u musbat bo‘lsa, unga 1 sonini qo‘shish, aks holda o‘zini chiqarish dasturini tuzing.
a=int(input('a='))
if a>0:
a=a+1
print('a=',a)
input
46-dars 6-topshiriq
6.Kiritilgan butun son musbat bo‘lsa, uning 10 ga ko‘paytmasini, aks holda o‘zini chiqaruvchi dastur tuzing.
a=int(input('a='))
if a>0:
a=a*10
else:
a=a
print('a=',a)

47-dars. TARMOQLANUVCHI ALGORITMLARNI DASTURLASH.


ELIF OPERATORI
1. Ikki xonali sonning raqamlari toq ekanligini aniqlovchi dastur tuzing.
47-dars 1-misol a=int(input('bi=')) b=a//10
i=a%10
if b%2!=0 and i%2!=0:
print('raqamlar toq',b,':',i) else:
print(' raqamlar toq emas',b,':',i)
input()
47-dars 2-misol
2. Uch xonali sonda bir xil raqamlar mavjudligini aniqlovchi dastur tuzing.
print('uch xonali son kriting') a=int(input('a='))
b=a%10
i=b%10
u=i%10
if b==i or i==u or b==u:
print('bir hil raqamlar mavjud') else:
print('bir hil raqamlar mavjud emas') input()
47-dars 3-misol
3. a va b sondan qaysi biri juft ekanligini aniqlovchi dastur tuzing.
a=int(input('a=')) b=int(input('b='))
a1=a%10
a2=b%10
if a1%2==0:
print('a soni juft',a) if a2%2==0:
print('b soni juft',b) input()
47-dars 4-misol
4. 3 ta butun son kiritildi. Qaysi biri juft ekanligini aniqlovchi dastur tuzing.
a=int(input('a=')) b=int(input('b=')) c=int(input('c=')) a1=a%10
a2=b%10
a3=c%10
if a1%2==0:
print('a soni juft',a) if a2%2==0:
print('b soni juft',b) if a3%2==0:
print('c soni juft',c)

48-dars. AMALIY MASHG‘ULOT



  1. Uchta a, b va c butun son berilgan. Ular orasidan musbatlari sonini topish dasturini tuzing.

48-dars 1-mashq
a=int(input('a=')) b=int(input('b=')) c=int(input('c=')) s=0
if a>0:
s+=1
if b>0:
s+=1
if c>0:
s+=1
print('musbat sonlar',s,'ta') input()
Download 78 Kb.

Do'stlaringiz bilan baham:




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2022
ma'muriyatiga murojaat qiling