The problem is that you are using integers instead of floating point (decimal) numbers. The idea is that in integer division, 3/4
becomes 0
, as opposed to 0.75
. This is called truncated division. Floating point numbers don't do this, so you get 3/4
= 0.75
shares = float(input("How many shares did you purchase: "))
price = float(input("At what price did you buy: "))
commission = float(input("How much did you pay in commission: "))
break_even= ((shares*price)+commission)/(shares)
print break_even