Ad
  • Custom User Avatar

    Oh, interesting usage of this Python stuff. Thanks for the explanation.

  • Custom User Avatar

    Here, [-1,1] is the array and this [g=="boy"] indicates the position of the array to be taken based on the condition. If the gender = "boy", then [-1, 1][1] would return 1 as the condition is true and if the gender = "girl", then [-1, 1][0] would return -1 as the condition is false. Basically, it is a [array][position] arrangement.

  • Custom User Avatar

    Like for this one, but what is [-1,1][g=="boy"]? How it is work and when you can use this?

  • Custom User Avatar

    Sure. I'm new noob.

  • Custom User Avatar

    Don't you think that's some excessive {}'s ? And again, a complicated solution for a simple question? But Yaa, I do understand that everybody's free to bring their own solutions in.