+ 10
How the answer is 2? I want Explaination.
Here is the SS. I want to know how the answer is 2 and how count woks for array? https://www.sololearn.com/post/487122/?ref=app
6 Answers
+ 10
Yes, very sure, Namit Jain .
AJ #L1G3 , this is because
true == 1, false == 0, therefore the last two assignments override the previous two..., finally the array contains only two elements
+ 8
MiKoLaš„3L17.4L16.2.5k=>L18 Ok got it. Here array contains objects so false will replaced by 0 and true will replaced by 1.
+ 7
true == 1
false == 0
So,
We have only 2 termsš¤
Not sureš¦
+ 5
AJ #L1G3 yesš¦
+ 3
Dictionaries should have unique keys.
Here true and 1 are the same so only one key is initialized.
Same goes to false and 0.
Thus it results in an array of length 2.
Happy coding!