Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

order of operations in python

Name: Anonymous 2013-05-03 5:47

hey guys just trying to figure out what i have wrong here... here's a simple conversion in python (fahrenheit to celsius)

c = 5 / 9 * float (f - 32)

i'm not sure why this will not convert properly but i'm guessing it has to do with the way python does order of operations

this is what i'm coming up with
http://gyazo.com/3735a2a4608bd3f7f36d79f5140ea3b1.png

so when you put in float (f - 32), is basically what's going on is python is not treating f - 32 as a "parentheses" in order of operations and doing the division before anything else.....also if i remember correctly PEMDAS has "Multiplication" clearly ahead of "Division" so why does Python do the division before anything else?

Name: Anonymous 2013-05-03 14:38

OP is stupid fukin goyim. No wonders jews are the EXPERT PROGRAMMERS

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List