On this page -- that I saw advertised on reddit -- I was asked a question that I used the Python programming language to get my computer to figure out. Unless I'm missing something, the answer (of 6) that I gave was correct, but the question said the correct answer is -6. Please could someone explain to me what I'm missing?

If I'm not missing anything; what? Am I supposed to take their word for it over my computer's? If anyone wants to take it up -- if I'm not missing anything -- you can argue with the code. The computer doesn't lie:

```
answer = (-4 ** (1 / 2)) * (-9 ** (1 / 2))
print(answer)
print(answer == -6)
```

Thank you for the help. :)

No vote yet

1 vote

×

Problem Loading...

Note Loading...

Set Loading...

Easy Math Editor

`*italics*`

or`_italics_`

italics`**bold**`

or`__bold__`

boldNote: you must add a full line of space before and after lists for them to show up correctlyparagraph 1

paragraph 2

`[example link](https://brilliant.org)`

`> This is a quote`

Remember to wrap math in \( ... \) or \[ ... \] to ensure proper formatting.`2 \times 3`

`2^{34}`

`a_{i-1}`

`\frac{2}{3}`

`\sqrt{2}`

`\sum_{i=1}^3`

`\sin \theta`

`\boxed{123}`

## Comments

Sort by:

TopNewestIn python,

`**`

binds stronger than`-`

. So, you need extra parantheses.That said, python was not built with the purpose of mathematical explorations in mind. You should not believe python as the ultimate judge.

Here is what Mathematica thinks.

Log in to reply

Never mind with the first one; you already have. Sorry.

Log in to reply

Okay, I will try to clarify what I meant.

Log in to reply

I will note that while wisdom (the ability to answer questions correctly independently without outsourcing) might not be something that can be outsourced by definition, computers can do certain tasks really well. If you use a calculator and think the calculator produced the wrong output to your input, though, you would have to be pretty stupid. It's possible that your input is wrong, but not that the calculator's output is wrong. I feel I'm stating the obvious here.

My input was wrong, so I got the right output for the code I gave Python, but the wrong output for the question I tried and failed to answer with the code. I used a calculator and it said the same thing, but the question I put in the calculator was not the question the quiz was asking.

Thank you for reading this. I appreciate conversation. :)

Log in to reply

My point in discussing the bulletted points were to answer your question of

Log in to reply

Log in to reply

Please can you give me an example or source that demonstrates not using extra parentheses returning the wrong answer? Please could you also give me an example or source that says that Python 3 is not suitable for general mathematical use? Thank you.

Log in to reply