Reputation: 13
I have tried two different syntax's and when I ran the syntax's I got the mathmatical resolution in both attempts, but my quiz is wanting a specific line of code to get the result. Any idea how I'm S U P P O S E D to get python to calculate this?
Upvotes: 0
Views: 357
Reputation: 166
You should try this one. It will help you understand the operator order better.
(1+(5**(0.5)))/2
Hope this helps
Upvotes: 0
Reputation: 4799
This is not really a python problem and more a maths order of operations problem.
In both examples you provide, you are adding the 1
after you divide (5**(1/2)/2)
.
You want this:
ratio = (1 + 5**(1/2)) / 2
Upvotes: 1