a=int(input('a='))
b=int(input('b=')) c=a+b
if a>0 and b>0 and c>100: s=a/b
if a>0 and b>0 and c<=100: s=a*b
print(s) input()
#48-dars 8-mashq
#8.Ikkita son berilgan. Agar birinchi son ikkinchisidan katta #bo‘lsa, 1 ni, agar ikkinchi son birinchisidan katta bo‘lsa,
#2 ni, agar ikkalasi teng bo‘lsa, 0 ni chiqaruvchi dastur tuzing.
a=int(input('a='))
b=int(input('b=')) if a>b:
print(a) if b>a:
print(b) if a==b:
print(0)
#49–50-darslar. TAKRORLANUVCHI ALGORITMLARNI DASTURLASH. #FOR OPERATORI
#49-dars 1-topshiriq
#1.a va b sonlar berilgan. a dan b gacha bо‘lgan barcha #sonlarni chiqaruvchi dastur tuzing. Bu yerda a <= b.
print('a<=b shartni bajaruvchi a va b sonlarini kiriting ') a=int(input('a='))
b=int(input('b=')) if a>b:
print('xato kiritdingiz') else:
for i in range(a,b+1): print(i, end=':')
input()
#49-dars 2-topshiriq
#2.a va b sonlar berilgan. Agar a < b bо‘lsa, a dan b gacha #bо‘lgan sonlarni о‘sish tartibida, aks holda kamayish #tartibida chiqaring.
a=int(input('a='))
b=int(input('b=')) if a
for i in range(b,a-1,-1):
print(i, end=':') if a>=b:
for i in range(a,b-1,-1):
print(i, end=':') input()
#49-dars 3-topshiriq
#3.1 dan 10 gacha bо‘lgan natural sonlar kvadratlarini #chiqaruvchi dastur tuzing.
for i in range(1,11): print(i,'ni kvadrati',i*i)
input()
#49-dars 4-topshiriq
#4.1 dan 10 gacha bо‘lgan natural sonlar yig‘indisini #chiqaruvchi dastur tuzing.
i=1;s=0
for i in range(11):
s=s+i print('s=',s)
#51-dars. AMALIY MASHG‘ULOT
Do'stlaringiz bilan baham: |