Operatorlar haqida
iamafruz777
Posted on March 29, 2023
Assalamu aleykum hurmatli dasturchi bugun siz bilan Python dasturlash tilida Operatorlar haqida ko'rib chiqamiz
Operator
- o'zgaruvchilar va qiymatlar ustida bajarish uchun ishlatiladi
Python operatorlar quyidagi guruhlar ajratadi:
-
Arifmetik operatori
-Belgilash operatorlari
Taqqoslar operatorlari
-
Mantiqiy operatorlari
-Identifikatsiya opetorlari
A'zolik operatorlari
-
Bitli operatorlar
Python arifmetik operatorlar
Arifmetik operatorlar
umumiy matematik amallarni bajarish uchun raqamli qiymatlar bilan ishlariladi:
Operator Name Example/Operator Nomiga Misol
- 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
== 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.
Posted on March 29, 2023
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.