Python Programming for Biology: Bioinformatics and Beyond



Download 7,75 Mb.
Pdf ko'rish
bet451/514
Sana30.12.2021
Hajmi7,75 Mb.
#91066
1   ...   447   448   449   450   451   452   453   454   ...   514
Bog'liq
[Tim J. Stevens, Wayne Boucher] Python Programming

Comparison operators

The  following  table  lists  the  standard  item  comparison  operations  that  are  built  into

Python,  to  compare  the  value  or  identity  of  objects.  Note  that  in  Python  3  inequality

comparisons can only be made on objects of a comparable type. In Python 2 you can make

the  comparison  2  <  ‘a’  (even  though  it  does  not  really  make  sense)  but  this  is  illegal  in

Python 3.



Operator

Description

Example

==

Tests whether two operands (either side of the



operator) have the same value, giving True if

they do and False otherwise.

x = 3 * 5

if x == 15:

print("Equal")

!=

Tests whether two operands have different



values, giving True if they do and False

otherwise.

seq = 'GCGC'

if seq !=

'TATA':

print("Not

equal")

>

Tests whether the value of the first operand is



greater in value than the second, giving True if

it is and False otherwise.

x = 2**10

x > 1024


Evaluates to False;

2

10



is exactly

1024, not greater.



<

Tests whether the value of the first operand is



smaller in value than the second, giving True if

it is and False otherwise.

x = 2**10

x < 1025


Evaluates to True.


>=

Tests whether the value of the first operand is




Download 7,75 Mb.

Do'stlaringiz bilan baham:
1   ...   447   448   449   450   451   452   453   454   ...   514




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish