I just started learning python, and I wrote these three lines of code:
points = 49
total = points / 50 * 500 + 40
print "omg wtf ", total
And I expected the output to be something like 530, but instead, no matter what I do, I keep getting 40. I tried initializing total to 0, casting the assignment to an int, I threw in a buttload of parentheses, but nothing works. I'm so baffled... Can someone help me / tell me what the heck is going on?
No comments:
Post a Comment