0

Python Boolen

How print(bool("abc")) outout True

17th Apr 2020, 6:49 PM
Rohit Singh
Rohit Singh - avatar
2 Answers
+ 5
from... https://www.w3schools.com/JUMP_LINK__&&__python__&&__JUMP_LINK/python_booleans.asp Most Values are True Almost any value is evaluated to True if it has some sort of content. Any string is True, except empty strings. Any number is True, except 0. Any list, tuple, set, and dictionary are True, except empty ones.
17th Apr 2020, 7:16 PM
rodwynnejones
rodwynnejones - avatar
+ 4
Boolean value of empty objects like (), [], {} and 0 is False and otherwise True.
17th Apr 2020, 10:23 PM
Qasem