#๐ Help understanding error message
24 messages ยท Page 1 of 1 (latest)
@languid crescent
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.
I have now fixed it lol
But also: show the error itself. It's quite important.
isnt this wrong? sqrt(x) + sqrt(y) is not the same as sqrt(x+y), ex. sqrt(2) + sqrt(2) is 2sqrt(2) but sqrt(2 + 2) = sqrt(4) = 2.
should be sqrt( abs(x1-x2)**2 + abs(y1-y2)**2 )
@wintry estuary it was but I finally realized what was wrong and fixed it
Omit the absolute
square of negative is positive
its not abs((x1-x2)**2)
its abs(x1-x2)**2
you aren't squaring a negative
if x1 > x2 or x2 > x1 its the same either way
with abs
but then you square it immediately after
which makes the absolute value irrelevant
!e print((-2)**2)
:white_check_mark: Your 3.12 eval job has completed with return code 0.
4
oh wait yeah
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.