### Ticker

6/recent/ticker-posts

# Python Language tutorial for beginners

Boolean Values in python for beginners at home  (2021 grasp basic python online with role model)

Boolean Values in Python:

In every context or program or theory, everyone wants to know what is true and what is false.

In Python language boolean represents what is true and what is false. This boolean gives an answer when we compare any two values whether the condition is true or false.

print(13 > 7)
print(13 == 7)
print(13 < 7)

#### • NOTE: There are some values that mostly happen True. Except for the empty strings, lists, tuples, and 0 in a number any strings, lists, tuples are "True".

#### Example:

print(bool("abc"))
print(bool(123))
print(bool(["apple", "cherry", "banana"]))

#### Expected Output:

• NOTE: There are some values that happen False. (), {}, 0, " ", [] are always "False".

print(bool(""))
print(bool(0))
print(bool(()))
print(bool([]))
print(bool({}))

#### Code:

def myFunction() :
return True

if myFunction():
print("YES!")
else:
print("NO!")

Post Navi