How to confuse a Python developer

preview_player
Показать описание
How to confuse a Python developer. Do you know the explanation?

~~~~~~~~~~~~~~~ CONNECT ~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~ SUPPORT ME ~~~~~~~~~~~~~~

#Python #shorts
Рекомендации по теме
Комментарии
Автор

Inconsistent use of brackets
First expression: True -> evaluates to True
Second expression: True -> evaluates to True
Third expression: True == (True, True, True) -> evaluates to False

LoradLP
Автор

True, True, True == (True, True, True)
=> True, True, (True == (True, True, True))
=> True, True, False

sunrimii
Автор

More like: How to confuse a non-python developer

holderman
Автор

For anyone that is still confused, it can be rewrited as: (bool, bool, (bool == tuple)), where the last item in the tuple is a comparison between a bool and a tuple

gabe
Автор

How to confuse a python developer:
int*

shaddonai
Автор

Not a python developer, but after seeing the thumbnail this was actually my expectation.

TunaAlert
Автор

When your boss asked you create a train

me: a tru tru train

anh.
Автор

You can also chceck with "False == True, True, True" which gives you "(False, True, True). If you decouple it, first the "False == True" is evaluated which is False. Then just "replace" the "True == False" with "False" and you get the tuple expression "False, True, True" which results in the final tuple "(False, True, True)".

dorko
Автор

As a Python developer, all you need to do to confuse me is int*

algorithmssimplified
Автор

It makes sense if each expression is spaced out on different lines. The first two trues are just Boolean values, and the third is the comparison.

MyNameIsSalo
Автор

Not confusing, you throw the person with the initial statement. The first two statements are just True, the last one is compared against the tuple which of course is False as True doesn't equal a tuple of True.

TheStickofWar
Автор

Impressive, very nice, lets now try confusing JavaScript developers.

_b
Автор

Inconsistent use of comma ", "
1. True,
2. True,
3. True == (True, True, True)
This is the order of operations
So in 3, we are comparing Boolean with Tuple whereas in 1, 2 we are just showing TRUE in stdout.

crimsoncad
Автор

True, True, (True, True, True) == (True, True, True) returns (True, True, True)

garganzalo
Автор

Keep 'em coming! It's a great way to learn

SaraKolvinsky
Автор

Another thing to notice is that this IDE does require print statement so that also a thing to consider

dastagirwajahat
Автор

The third tuple of the result was the evaluation of (True == ( True, True, True))

SakibSadmanShajib
Автор

title should be: how to confuse anyone in 10 seconds

yeahuh
Автор

It evaluates to (True, True, (True == (True, True, True))

zhh
Автор

The final tuple is essentially a tuple of the first two Trues from the left side and the result of comparing the third True with the tuple on the right side (which is False, as True != (True, True, True)). Another example would be `True, True, 0 > 1` 😄

MateuszModrzejewski