22nd Jul 2019, 6:02 AM
Vadim Lusto
Vadim Lusto - avatar
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.
22nd Jul 2019, 6:14 AM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar
+ 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 🙂
22nd Jul 2019, 6:13 AM
David Ashton
David Ashton - avatar
+ 2
Sammash Mashsam I believe that you made a typo. As Python uses Capitalised 'True' / 'False' for its boolean expressions.
22nd Jul 2019, 11:24 AM
Kosai Al Khateb
Kosai Al Khateb - avatar
+ 1
not true=false and note that python doesnot use uppercase F or T for boolean expression unlike other languages!!!!!
22nd Jul 2019, 6:20 AM
Sammash Mashsam
Sammash Mashsam - avatar
+ 1
thank you guys!! got it
22nd Jul 2019, 3:30 PM
Vadim Lusto
Vadim Lusto - avatar