Learning Python: The Ultimate Guide for Beginners to Coding with Python with Useful Tools


Sample Program to Illustrate Operators in Python



Download 2,02 Mb.
Pdf ko'rish
bet31/126
Sana01.01.2022
Hajmi2,02 Mb.
#285662
1   ...   27   28   29   30   31   32   33   34   ...   126
Bog'liq
Learning Python The Ultimate Guide for Beginners to Coding with

Sample Program to Illustrate Operators in Python
# Arithmetic Operators
number1 = 8
number2 = 4
print(number1 + number2)
print(number1 –number2)
print(number1 * number2)
print(number1 / number2)
print(number1 % number2)
print (number1 **2)
#Comparison Operators
number3 = 13
number4 = 9
print(“number3 > number4”, number3 >number4)
print(“number3 < number4”, number3 print(“number3 != number4”, number3 !=number4)
print(“number3 >= number4”, number3 >= number4)
print(“number3 <= number4”, number <= number4)
#Assignment Operators
number5 = 9
number6 = 6


print(("The value of number5 is : ", number5))
print(("The value of number6 is : ", number6))
#Logical Operators
number7 = True
number8 = False
print ((“NOT number8 is: ” NOT number8))
print ((“number7 OR number8 is: ” number7 OR number8))
print ((“number7 AND number8 is: ” number7 AND number8))
#Membership Operators
number9 = 5
number10 =63
new_list = [17, 5, 9, 7, 20, 63 ];
if ( number9 in new_list ):
print("number9 is available in our given list.")
else:
print("number9 is unavailable in our given list")
if ( number10 not in new_list ):
print("Number10 is not available in our given list.")
else:
print("number10 is available in our given list")

Download 2,02 Mb.

Do'stlaringiz bilan baham:
1   ...   27   28   29   30   31   32   33   34   ...   126




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