+ 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

7th Aug 2020, 5:11 PM
AĶ¢J
AĶ¢J - avatar
5 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
7th Aug 2020, 5:19 PM
ProfOduolašŸ™šŸ‡³šŸ‡¬
ProfOduolašŸ™šŸ‡³šŸ‡¬ - avatar
+ 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.
7th Aug 2020, 5:26 PM
AĶ¢J
AĶ¢J - avatar
+ 7
true == 1 false == 0 So, We have only 2 termsšŸ¤” Not surešŸ‘¦
7th Aug 2020, 5:13 PM
Namit Jain
Namit Jain - avatar
+ 5
AJ #L1G3 yesšŸ‘¦
7th Aug 2020, 5:27 PM
Namit Jain
Namit Jain - avatar
+ 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!
9th Aug 2020, 2:53 AM
MSN
MSN - avatar