Sinisterly
little brain teaser! - Printable Version

+- Sinisterly (https://sinister.ly)
+-- Forum: Coding (https://sinister.ly/Forum-Coding)
+--- Forum: Coding (https://sinister.ly/Forum-Coding--71)
+--- Thread: little brain teaser! (/Thread-little-brain-teaser)



little brain teaser! - BlueCat - 06-17-2014

For the noobies(including myself).

I like doing little games. :troll:

Ok. Let's get started.

Code:
A = 2 A = 6 A = 8 A = 10 A = 20 B = 2 B = 6 B = 8 B = 10 B = 20

Now we've got that out the way. What does a == b equal to and it is true or false? :troll:


RE: little brain teaser! - alok9shm - 06-17-2014

Please don't mess with Caps and Smalls. If you mean A==B, then It will return True, as A contains 20 and B also contains 20.


RE: little brain teaser! - NinjaKnight - 06-17-2014

This would always be true. A will last be edited by 'A = 20', and B will always be edited last by 'B = 20'.

Hence, it will always be true.

-NinjaKnight-


RE: little brain teaser! - thewalker - 06-17-2014

true all the time simple enough i think once you figure out that a=20 and b=20


RE: little brain teaser! - BlueCat - 06-17-2014

(06-17-2014, 04:01 AM)alok9shm Wrote: Please don't mess with Caps and Smalls. If you mean A==B, then It will return True, as A contains 20 and B also contains 20.

I know but since am on my phone it automatically doed capital letters


RE: little brain teaser! - alok9shm - 06-17-2014

(06-17-2014, 09:30 AM)root@localhost Wrote:
(06-17-2014, 04:01 AM)alok9shm Wrote: Please don't mess with Caps and Smalls. If you mean A==B, then It will return True, as A contains 20 and B also contains 20.

I know but since am on my phone it automatically doed capital letters
Hmmm.. Variable names in Python are case sensitive. Take care of that.


RE: little brain teaser! - BlueCat - 06-17-2014

(06-17-2014, 09:35 AM)alok9shm Wrote:
(06-17-2014, 09:30 AM)root@localhost Wrote:
(06-17-2014, 04:01 AM)alok9shm Wrote: Please don't mess with Caps and Smalls. If you mean A==B, then It will return True, as A contains 20 and B also contains 20.

I know but since am on my phone it automatically doed capital letters
Hmmm.. Variable names in Python are case sensitive. Take care of that.

I know....


RE: little brain teaser! - 1234hotmaster - 06-17-2014

are you asking for a truth table of some sort?


RE: little brain teaser! - Windows65 - 07-06-2014

If you create a loop to check every variable in order, the result would be True every time.
If you add all A vars and all B vars the outcome would be the same.
It just depends on how you think about it, their are many answers to this question.