How to Get Boolean Answer in Python


In this example we will show how to evaluate variables and get the Boolean answer in Python.

Source Code

a = 'Python'
b = '6.6'
c = 6.6

print(bool(a))
print(bool(b))
print(bool(c))

Output:

True
True
True
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments