How do I write a program to calculate profit

python

#1

Here's my code, it didn't work:

buy1= raw_input("You bought item 1 for: ")
buy2 =raw_input("You bought item 2 for: ")
buy3 =raw_input("You bought item 3 for: ")
sold1=raw_input("You sold item 1 for: ")
sold2=raw_input("You sold item 2 for: ")
sold3=raw_input("You sold item 3 for: ")



def profit_calculator(a,b,c):
    a =profit1 = int(sold1)- int(buy1)
    b =profit2 = int(sold2) - int(buy2)
    c =profit3 = int(sold3) - int(buy3)
    return "Your profits are " + profit1 , profit2, profit3

#2

def profit_calculator():
    profit1 = int(sold1) - int(buy1)
    profit2 = int(sold2) - int(buy2)
    profit3 = int(sold3) - int(buy3)
    return "Your profits are " + profit1 + " " + profit2 + " " + profit3 + "."

#3

Thanks, but how do I call/use the function?


#4

I believe it's just by typing

profit_calculator()

#5

When I do it tells me
Traceback (most recent call last):
File "python", line 16, in
File "python", line 14, in profit_calculator
TypeError: cannot concatenate 'str' and 'int' objects