-2
total=0
output=("enter next sales value")
sales=input
total_sales=total+sales

I keep getting this error:

Traceback (most recent call last): File "python", line 4, in TypeError: unsupported operand type(s) for +: 'int' and 'builtin_function_or_method'

halfer
  • 19,824
  • 17
  • 99
  • 186
jimmy vardy
  • 17
  • 1
  • 1
  • 1

1 Answers1

1

You must use input() instead of input. Moreover in python 3, the input() function returns a string, not an integer. So to use the return value in an addition, you must indicate it as an integer:

    sales = input("Enter next sales value")
    total_sales = total + int(sales)
Laurent H.
  • 6,316
  • 1
  • 18
  • 40