+ 2
Explain me the difference plz
5 odpowiedzi
+ 8
"False" is a value that when converted to boolean returns True.
False itself is a boolean that is well, False.
Therefore not "False"->0 (Actually False)
And not False ->1 (Actually True)
Therefore add 1 and see the results.
+ 2
bool() gives you whether something is True or False. bool("False") is True because you used quotes, which turned False into a string "False", and adding not makes it false, i.e. 0.
Try your code without the quotes 🙂
+ 2
Sammash Mashsam
I believe that you made a typo. As Python uses Capitalised 'True' / 'False' for its boolean expressions.
+ 1
not true=false and note that python doesnot use uppercase F or T for boolean expression unlike other languages!!!!!
+ 1
thank you guys!! got it