Telegram Group & Telegram Channel
Python dasturlash maktabi
⭕️ 2-bo'lim “Operatorlar” ————————————— Ⓜ️Operatorlar guruhlari? ----------------------------- Pythonda operatorlar quyidagi guruhga bo'linadi. Arifmetik operatorlar Tayinlash operatorlari Taqqoslash operatorlari Mantiqiy operatorlar Identifikatsiya operatorlari…
Ⓜ️ Identifikatsiya operatorlari

Identifikatsiya operatorlari ma'lumotlarning xotira birligini aniqlash uchun ishlatiladi.

Xotira... Python xotirani hisobga olmaydi deyishadiku?
CPython ob'ektlari xotirani boshqarishni optimallashtirish uchun juda ko'p xotiradan foydalanadi.Bunga misol CPython -5 dan 256 gacha bo'lgan barcha butun sonlarning global ro'yxatini saqlaydi va bularning hammasi uchun 266 * 24 = 6384 baytni oldindan ajratadi.

Ma'lumotlar turi nima u?
Ma'lumotlar turiga namunalar:
str satr 'salom'
int butun sonlar 2
float haqiqiy sonlar 2.03
bool mantiqiy True yoki False

a = 28
b = 19
a va b o'zgaruvchi
28 va 19 ma'lumot
ma'lumot turi int

a va b o'zgaruvchilar ma'lumot turi bir xil lekin xotirada joylashuvi farq qilishi mumkin.
Ma'lumot xotirada joylashishini ko'rish uchun id() funktsiyasidan foydalanamiz.
>>> print(id(a))
11429120
>>> print(id(b))
11428832


is - Agar ikkala o'zgaruvchi bir xil ob'ekt bo'lsa rost (True) qaytaradi, boshqa holatda yolg'on (False) qaytaradi
print(a is b) False
print(True is False) False
print(False is False) True
print(True is True) True


is not - Agar ikkala o'zgaruvchi bir xil ob'ekt bo'lmasa rost (True) qaytaradi, boshqa holatda yolg'on (False) qaytaradi
print(a is not b) True
a = 5
b = 5
print(a is not b) False

@pythonuz



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

Ⓜ️ Identifikatsiya operatorlari

Identifikatsiya operatorlari ma'lumotlarning xotira birligini aniqlash uchun ishlatiladi.

Xotira... Python xotirani hisobga olmaydi deyishadiku?
CPython ob'ektlari xotirani boshqarishni optimallashtirish uchun juda ko'p xotiradan foydalanadi.Bunga misol CPython -5 dan 256 gacha bo'lgan barcha butun sonlarning global ro'yxatini saqlaydi va bularning hammasi uchun 266 * 24 = 6384 baytni oldindan ajratadi.

Ma'lumotlar turi nima u?
Ma'lumotlar turiga namunalar:
str satr 'salom'
int butun sonlar 2
float haqiqiy sonlar 2.03
bool mantiqiy True yoki False

a = 28
b = 19
a va b o'zgaruvchi
28 va 19 ma'lumot
ma'lumot turi int

a va b o'zgaruvchilar ma'lumot turi bir xil lekin xotirada joylashuvi farq qilishi mumkin.
Ma'lumot xotirada joylashishini ko'rish uchun id() funktsiyasidan foydalanamiz.

>>> print(id(a))
11429120
>>> print(id(b))
11428832


is - Agar ikkala o'zgaruvchi bir xil ob'ekt bo'lsa rost (True) qaytaradi, boshqa holatda yolg'on (False) qaytaradi
print(a is b) False
print(True is False) False
print(False is False) True
print(True is True) True


is not - Agar ikkala o'zgaruvchi bir xil ob'ekt bo'lmasa rost (True) qaytaradi, boshqa holatda yolg'on (False) qaytaradi
print(a is not b) True
a = 5
b = 5
print(a is not b) False

@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/299

View MORE
Open in Telegram


Python dasturlash maktabi Telegram | DID YOU KNOW?

Date: |

How to Buy Bitcoin?

Most people buy Bitcoin via exchanges, such as Coinbase. Exchanges allow you to buy, sell and hold cryptocurrency, and setting up an account is similar to opening a brokerage account—you’ll need to verify your identity and provide some kind of funding source, such as a bank account or debit card. Major exchanges include Coinbase, Kraken, and Gemini. You can also buy Bitcoin at a broker like Robinhood. Regardless of where you buy your Bitcoin, you’ll need a digital wallet in which to store it. This might be what’s called a hot wallet or a cold wallet. A hot wallet (also called an online wallet) is stored by an exchange or a provider in the cloud. Providers of online wallets include Exodus, Electrum and Mycelium. A cold wallet (or mobile wallet) is an offline device used to store Bitcoin and is not connected to the Internet. Some mobile wallet options include Trezor and Ledger.

Telegram today rolling out an update which brings with it several new features.The update also adds interactive emoji. When you send one of the select animated emoji in chat, you can now tap on it to initiate a full screen animation. The update also adds interactive emoji. When you send one of the select animated emoji in chat, you can now tap on it to initiate a full screen animation. This is then visible to you or anyone else who's also present in chat at the moment. The animations are also accompanied by vibrations. This is then visible to you or anyone else who's also present in chat at the moment. The animations are also accompanied by vibrations.

Python dasturlash maktabi from sg


Telegram Python dasturlash maktabi
FROM USA