+ 1

# Can someone help me explain because am really confused here.

When I print the exponential of 9 ** 1/2, I get 4.5 but when I print 9 ** 0.5 that's when I get 3.0 but in the python 3 course it's saying the exponential of 9 ** 1/2 is 3.0

6 Answers

+ 6

Order of operations will make:
9**1/2
Equivalent to:
(9**1) / 2
Try:
9**(1/2)

+ 9

it should be 4.5 since ** has higher precedence (in python at least)
https://study.com/cimages/multimages/16/precedence_table.png

+ 4

de malong Yep. This would apply in all programming languages, as well as, written math and standard calculators.

+ 3

This is a copy from the python tutorial:
>>> 2**5
32
>>> 9 ** (1/2)
3.0

+ 2

Yeah that what I thought but the tutorials says otherwise https://www.sololearn.com/learn/JUMP_LINK__&&__Python__&&__JUMP_LINK/2273/

+ 2

David Carroll thanks it work so basically we'd have to put brackets around 1/2