Telegram Group & Telegram Channel
Python dasturlash maktabi
Testlarni guruhlarga ulashing! 🗓MUNDARIJA: --------------------------- ⭕️ 1-bo'lim “Asosiy tushunchalar” Ⓜ️ Python nima? Ⓜ️ Birinchi dastur Ⓜ️ Oddiy operatsiyalar Ⓜ️ Haqiqiy sonlar Ⓜ️ Matnlar (strings) Ⓜ️ O'zgaruvchilar (Variables) Ⓜ️ Ma'lumotlarni olish…
⭕️ 3-bo'lim "Nazorat tarkibi"
—————————————

Ⓜ️ "if" va "elif" operatorlari

Biror shart bajarish uchun if operatorlaridan foydalanishingiz mumkin va shart operatori deyarli barcha dasturlarda ishtirok etadi.
Shart operatori 3 qismdan iborat (if, elif, else).

Kod bloklarini chegaralash uchun shart operatoridan pastki qism 4 ta bo'sh joy yoki 1 ta tabulyatsiyadan boshlanadi.

Agar ifoda rost bo'lsa shart operatori pastki qismidagi kod ishga tushadi, aks holda e'tiborsiz qoldiriladi.

x = 7
if x == 7:
print("x 7 ga teng")
x 7 ga teng

Shartlar bajarilishida birinchi if operatoridan foydalaniladi.So'ng elif yoki else operatorlaridan foydalanishingiz yoki foydalanmasligingiz mumkin.

Nima uchun elif operatori kerak?
⚠️
Agar hamma shartga if operatorini qo'llasak hamma shart operatorlari ishga tushadi.Agar birinchi shartga if shart operatori boshqa shartlarga elif shart operatoridan foydalansak elif shart operatori ishga tushsa qolgan operatorlar e'tiborsiz qoldiriladi.Quyidagi kodda 'x 18 ga teng' chop etilmadi sabab undan yuqoridagi elif operatori bajarildi.

x = 18
if x == 22:
print("x 22 ga teng")
elif x < 22:
print("x 22 dan kichik")
elif x == 18:
print("x 18 ga teng")
else:
print("Yuqoridagi shartlar ishga tushmadi")

x 22 dan kichik


else shart operatori boshqa holatlarda ishga tushadi.

x = 18
if x == 22:
print("x 22 ga teng")
elif x < 11:
print("x 11 dan kichik")
elif x == 15:
print("x 15 ga teng")
else:
print("Yuqoridagi shartlar ishga tushmadi")

Yuqoridagi shartlar ishga tushmadi

@pythonuz



tg-me.com/pythonuz/336
Create:
Last Update:

⭕️ 3-bo'lim "Nazorat tarkibi"
—————————————

Ⓜ️ "if" va "elif" operatorlari

Biror shart bajarish uchun if operatorlaridan foydalanishingiz mumkin va shart operatori deyarli barcha dasturlarda ishtirok etadi.
Shart operatori 3 qismdan iborat (if, elif, else).

Kod bloklarini chegaralash uchun shart operatoridan pastki qism 4 ta bo'sh joy yoki 1 ta tabulyatsiyadan boshlanadi.

Agar ifoda rost bo'lsa shart operatori pastki qismidagi kod ishga tushadi, aks holda e'tiborsiz qoldiriladi.

x = 7
if x == 7:
print("x 7 ga teng")
x 7 ga teng

Shartlar bajarilishida birinchi if operatoridan foydalaniladi.So'ng elif yoki else operatorlaridan foydalanishingiz yoki foydalanmasligingiz mumkin.

Nima uchun elif operatori kerak?
⚠️
Agar hamma shartga if operatorini qo'llasak hamma shart operatorlari ishga tushadi.Agar birinchi shartga if shart operatori boshqa shartlarga elif shart operatoridan foydalansak elif shart operatori ishga tushsa qolgan operatorlar e'tiborsiz qoldiriladi.Quyidagi kodda 'x 18 ga teng' chop etilmadi sabab undan yuqoridagi elif operatori bajarildi.

x = 18
if x == 22:
print("x 22 ga teng")
elif x < 22:
print("x 22 dan kichik")
elif x == 18:
print("x 18 ga teng")
else:
print("Yuqoridagi shartlar ishga tushmadi")

x 22 dan kichik


else shart operatori boshqa holatlarda ishga tushadi.

x = 18
if x == 22:
print("x 22 ga teng")
elif x < 11:
print("x 11 dan kichik")
elif x == 15:
print("x 15 ga teng")
else:
print("Yuqoridagi shartlar ishga tushmadi")

Yuqoridagi shartlar ishga tushmadi

@pythonuz

BY Python dasturlash maktabi


Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283

Share with your friend now:
tg-me.com/pythonuz/336

View MORE
Open in Telegram


Python dasturlash maktabi Telegram | DID YOU KNOW?

Date: |

What is Secret Chats of Telegram

Secret Chats are one of the service’s additional security features; it allows messages to be sent with client-to-client encryption. This setup means that, unlike regular messages, these secret messages can only be accessed from the device’s that initiated and accepted the chat. Additionally, Telegram notes that secret chats leave no trace on the company’s services and offer a self-destruct timer.

Telegram and Signal Havens for Right-Wing Extremists

Since the violent storming of Capitol Hill and subsequent ban of former U.S. President Donald Trump from Facebook and Twitter, the removal of Parler from Amazon’s servers, and the de-platforming of incendiary right-wing content, messaging services Telegram and Signal have seen a deluge of new users. In January alone, Telegram reported 90 million new accounts. Its founder, Pavel Durov, described this as “the largest digital migration in human history.” Signal reportedly doubled its user base to 40 million people and became the most downloaded app in 70 countries. The two services rely on encryption to protect the privacy of user communication, which has made them popular with protesters seeking to conceal their identities against repressive governments in places like Belarus, Hong Kong, and Iran. But the same encryption technology has also made them a favored communication tool for criminals and terrorist groups, including al Qaeda and the Islamic State.

Python dasturlash maktabi from sg


Telegram Python dasturlash maktabi
FROM USA