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

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