65
print (“Berilgan sonlarga qiymat kiriting”)
from math import *
a=int(input(“a=”))
b=int(input(“b=”))
print (“Sonlarning o’rta arifmetigi =”, (a+b)/2)
print (“Sonlarning o’rta geometrigi =”, sqrt(a*b))
Berilgan sonlarga
qiymat kirinting
a=54
b=24
Sonlarning o’rta arifmetigi =39.0
Sonlarning o’rta geometrigi =36.0
8 topshiriq
. To’g’ri burchakli uchburchak katetlari berilgan.
Uning
gipotenuzasi va yuzini toping.
Python dasturi:
print (“To'g'ri
burchakli uchburchak
tomonlarini kiriting”)
from math import *
a=int(input(“a=”))
b=int(input(“b=”))
print (“Uchburchak gipotenuzasi =”,
sqrt(a*a+b*b))
print (“Uchburchak yuzi =”, (a*b)/2)
To'g'ri
burchakli
uchburchak
tomonlarini kiriting
a=4
b=3
Uchburchak gipotenuzasi= 5.0
Uchburchak yuzi = 6.0
9 topshiriq
.
Yon sirti S, asosining yuzi Q bo’lgan
silindrning hajmi
hisoblansin.
Masalani qo’yilishi.
𝑉 = 𝑆
𝑎
𝐻 =
𝑄𝑆
2𝜋𝑅
𝑉 =
𝑆
2
√
𝑄
𝑃𝑖
Python dasturi:
from math import *
print(“Silindr yon sirti S qiymati kiriting”)
s=int(input(“s=”))
Silindr yon sirti S qiymati kiriting
s=9
Silindr asosining yuzi Q qiymati kiriting
66
print(“Silindr
asosining yuzi Q qiymati
kiriting”)
q=int(input(“q=”))
v=s/2*sqrt(q/pi)
print(“Slindir hajmi”, v)
q=4
Silindr hajmi= 5.077706251929807
10 topshiriq
. Asosining tomoni a, balandligi h bo’lgan muntazam oltiburchakli
prizmaning to’la sirtini toping.
Masalani qo’yilishi.
𝑆
𝑡
= 2𝑆
𝑎
+ 𝑆
𝑦𝑜
𝑆
𝑡
= 3√3𝑎
2
+ 6𝑎ℎ
Python dasturi:
from math import *
a=int(input(‘a=’))
h=int(input(‘h=’))
s=3*sqrt(3)+a**2+6*a*h
print(“Natija S=”, s)
a=4
h=6
Natija S= 165.19615242270663
Eslatma:
Python dasturlash tilida ikki sonni bo’lishda butun qismni olish uchun
//, kasr qismini olish uchun % belgilaridan foydalanamiz.
Dostları ilə paylaş: