How to make use of Boolean | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How to make use of Boolean

https://code.sololearn.com/c1SH4vDdwh1a/#py Can I use boolean to print true or false in the above code ??

1st Apr 2020, 2:04 PM
Mani
Mani - avatar
2 Answers
+ 2
Yes, but you will need to convert them to boolean. Like if x == 'yes': x = True
1st Apr 2020, 2:36 PM
你知道規則,我也是
你知道規則,我也是 - avatar
0
If you write something like... print(x=='yes') ... you'll also directly get the output as Boolean True (or False).
1st Apr 2020, 4:13 PM
HonFu
HonFu - avatar