Logical operators - Day 5

Fathima Shaila - Jul 19 - - Dev Community

Logical operators

Logical operators என்பது conditional statements ஐ இணைக்க உதவும்.

  • and
  • or
  • not

and
Conditional statements இரண்டும் உண்மையாக இருந்தால் True என்பதை வெளிப்படுத்தும்.

condition1 = True
condition2 = True

print("BANK BALANCE")
user_name = input("USER NAME")
password = int(input("PASSWORD"))
balance = 56765.00

if user_name == "Hiba" and password == 5566:
print(f"Your Balance is {balance}")
else:
print("Something Went Wrong Please Try Again")

or
இரண்டில் ஒரு conditional statements உண்மையாக இருப்பின் True ஐ வெளிப்படுத்தும்.

x = 5
print(x > 3 or x < 4)

True

not
Conditional statements இற்கு எதிரான விளைவைத் தரும். உண்மையாக இருப்பின் False என்றும் பொய்யாக இருப்பின் True என்றும் வெளிப்படுத்தும்.

x = 5
print(not(x > 3 and x < 10))

False

. . . . . . . . . .
Terabox Video Player