0

Please explain this code. Why output isn't false?

If("m"): print("It's true") else: print("It's false") Output: It's true

26th Dec 2020, 7:35 PM
Hushnudbek
Hushnudbek - avatar
5 Respostas
+ 1
Super, thank you for your help.
26th Dec 2020, 7:58 PM
Hushnudbek
Hushnudbek - avatar
0
A non-empty string is "true"
26th Dec 2020, 7:41 PM
rodwynnejones
rodwynnejones - avatar
0
Thank you very much :)
26th Dec 2020, 7:43 PM
Hushnudbek
Hushnudbek - avatar
0
If it's true, is this valid for int type
26th Dec 2020, 7:46 PM
Hushnudbek
Hushnudbek - avatar
0
Empty string, lists, tuples, dicts, sets, 0 (zero) and 0.0 (zero point zero) return false.
26th Dec 2020, 7:52 PM
rodwynnejones
rodwynnejones - avatar