DEV Community

iamafruz777
iamafruz777

Posted on

Operatorlar haqida

Assalamu aleykum hurmatli dasturchi bugun siz bilan Python dasturlash tilida Operatorlar haqida ko'rib chiqamiz

Operator
Enter fullscreen mode Exit fullscreen mode
  • o'zgaruvchilar va qiymatlar ustida bajarish uchun ishlatiladi
Python operatorlar quyidagi guruhlar ajratadi:
Enter fullscreen mode Exit fullscreen mode
  • Arifmetik operatori - Belgilash operatorlari
  • Taqqoslar operatorlari
  • Mantiqiy operatorlari -Identifikatsiya opetorlari
  • A'zolik operatorlari
  • Bitli operatorlar Python arifmetik operatorlar Arifmetik operatorlarumumiy matematik amallarni bajarish uchun raqamli qiymatlar bilan ishlariladi:
Operator Name Example/Operator Nomiga Misol
Enter fullscreen mode Exit fullscreen mode
  • Addittion/Qoshish x + y
  • Subtraction/Ayirish x - y
    • Multiplication/Ko'paytirish x * y / Division/Bo'linish x / y % Modulas/Foiz x % y Exponentiation/Eksponentatsiya x y // Floor division/Qavat bo'limi x // y

Operator ExampleSame As:/Operatorlarga Misollar sifatida:
= x = 5 x = 5
+= x +=3 x = x +3
-= x-3 x= x-3
= x *= 3 x *3
/= x/=3 x = x / 3
%= x%= x%=3 x = x % 3
//= x// = 3 x=x // 3
*
= x **=3 x=x **3

Operator Name Example/Operator Nomiga Misol 

Enter fullscreen mode Exit fullscreen mode

== Equal/Teng x == y
!= Not Equal/Teng emas x! =y>
Greater than/Kattaroq x > y
< Less than/Kamroq x < y

= Greater than or equal to/Dan katta yoki teng x <=y
<= Less than or equal to/Dan katta yoki teng x<=y

Keling endi misol koramiz:
x = int(input("Sonni kiriting"))
y = int(input("Ikkinchi sonni kiriting"))

x *=6
y +=7
print("Natija:",x)
print("Natija:",y)

Javob:
Buog'da xda 25 bolib turibdi deylik Keyin *ni koradide kod 25*6 yoki 25 sonini 7ga qoshvoradi,kopaytirilgan va qoshilgandegi javoblarini chiqazib qoyadi.

Top comments (1)

Collapse
 
afruzbek2010 profile image
iamafruz777

Layk bosib qoyamiza