1

To begin, I am new to all of this. I could have done this in excel, but decided this would be a good project to give a try. I used to be quick learning smart cookie, but I am mostly just stupid nowadays. I have no idea what this is caused by. It just doesn't make sense.

Here is what the console outputs:

What is the daily rate? 800

How many deployments in the year? 3
0.0
144000.0
Traceback (most recent call last):

File "<ipython-input-17-fb0f96552601>", line 1, in <module>
runfile('C:/Users/Business Laptop/.spyder-py3/temp.py', 
wdir='C:/Users/Business Laptop/.spyder-py3')

File "C:\ProgramData\Anaconda3\lib\site-
packages\spyder\utils\site\sitecustomize.py", line 710, in runfile
execfile(filename, namespace)

File "C:\ProgramData\Anaconda3\lib\site-
packages\spyder\utils\site\sitecustomize.py", line 101, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)

File "C:/Users/Business Laptop/.spyder-py3/temp.py", line 44, in <module>
tax_rate = tax_rate_calc(gross_income)

File "C:/Users/Business Laptop/.spyder-py3/temp.py", line 38, in 
tax_rate_calc
return (.1*9525+.12*(gross_income-9525)+.22(gross_income-
38700)+.24(gross_income-82500))/gross_income

TypeError: 'float' object is not callable

When I look at the error, it is coming at a point where the code is identical to the previous code that did not throw the error....

daily_rate = float(input("What is the daily rate? "))

deployment = 60.0

rotations = float(input("How many deployments in the year? "))

def bonus_calc(rotations):
  if rotations > 3:
    return (rotations - 3) * 10000
  else:
    return 0.0



bonus = bonus_calc(rotations)

print(bonus)

gross_income = daily_rate * deployment * rotations

print(gross_income)

def tax_rate_calc(gross_income):
  if gross_income < 9525:
    return .1
  elif gross_income >= 9525 and gross_income < 38700:
    return (.1*9525+.12*(gross_income-9525))/gross_income
  elif gross_income >= 38700 and gross_income < 82500:
    return (.1*9525+.12*(gross_income-9525)+.22(gross_income-
    38700))/gross_income
  elif gross_income >= 82500 and gross_income < 157500:
    return (.1*9525+.12*(gross_income-9525)+.22(gross_income-
    38700)+.24(gross_income-82500))/gross_income
  elif gross_income >= 157500 and gross_income < 200000:
    return (.1*9525+.12*(gross_income-9525)+.22(gross_income-
    38700)+.24(gross_income-82500)+ .32(gross_income-157500))/gross_income
  elif gross_income > 200000:
    return (.1*9525+.12*(gross_income-9525)+.22(gross_income-
    38700)+.24(gross_income-82500)+ .32(gross_income-
    157500)+.35(gross_income-200000))/gross_income

tax_rate = tax_rate_calc(gross_income)

def taxes_owed_calc(tax_rate, gross_income):
  return tax_rate * gross_income

taxes_owed = taxes_owed_calc(tax_rate, gross_income)

def net_income_calc(gross_income, taxes_owed):
  return gross_income - taxes_owed

net_income = net_income_calc(gross_income, taxes_owed)

def monthly_equivalent_calc(net_income):
  return net_income / 12

monthly_equivalent = monthly_equivalent_calc(net_income)

print("Monthly income equivalent" + monthly_equivalent)

any help!?

  • Welcome to Stack Overflow! Stack Overflow is not a discussion forum, it is a Question and Answer site where you can ask a **specific** programming question that **can be answered** rather than discussed. Please read [How do I ask a good question?](https://stackoverflow.com/help/how-to-ask) and [What topics can I ask about here?](https://stackoverflow.com/help/on-topic) and then edit your question to conform with the site guidelines. Off-topic questions such as this one are routinely closed, but if edited to ask an *answerable* question, can be re-opened again. Thanks. – NightOwl888 Mar 04 '18 at 04:01

0 Answers0