#๐Ÿ”’ why?

11 messages ยท Page 1 of 1 (latest)

true wind
brazen pantherBOT
#

@true wind

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

true wind
#

Thanks for any answering, I'm new in python and I just don't understand:(

summer holly
#

1st part:
(3 > 2) =true (basic math)
in: checks if there is true in [True, False] and finds out there is true so it prints true

alpine frost
#

the last one is really because of operator chaning. Python allows you to do stuff like: x < y < z which gets interpreted as: x < y and y < z .. and that's what is happening in the 3rd one.
3 > 2 in [True, False] is interpreted as 3 > 2 and 2 in [True, False]

#

also True == 1 and False == 0

#

3 > (2 in [True, False])
2 is not in that list so it becomes: 3 > False which is 3 > 0

true wind
brazen pantherBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.

#

๐Ÿ”’ why?