Why the output is False???? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
11th Aug 2019, 12:14 PM
ANJALI SAHU
7 Answers
+ 3
RAJESH SAHU Your code is checking if array d is present in array d I then 'a' is present in array d. What output you were expecting?
11th Aug 2019, 12:37 PM
Sachin Artani
Sachin Artani - avatar
+ 3
'a' in d in d internally translates to: ('a' in d) and (d in d). The first part is true, but the second isn't, so the whole thing turns out False.
11th Aug 2019, 12:39 PM
HonFu
HonFu - avatar
+ 2
Thanks honfu☺️☺️☺️☺️☺️☺️☺️☺️☺️☺️☺️☺️
11th Aug 2019, 1:07 PM
ANJALI SAHU
+ 2
Cbr✔[ Not Active ] Sorry, I don't know Python much, but whatever it is, output is False.
11th Aug 2019, 4:01 PM
Sachin Artani
Sachin Artani - avatar
+ 2
If you want the output true Its should be: (a in d) in d. Its must be associative.
11th Aug 2019, 8:16 PM
James 🇷🇧
James 🇷🇧 - avatar
0
you have "in d" twice, remove the second one
11th Aug 2019, 12:16 PM
Steve Hope
Steve Hope - avatar
0
Steve Hope I am asking why this code has output as False... I am not asking to correct it
11th Aug 2019, 12:19 PM
ANJALI SAHU