<div dir="ltr"><div><div>Hello,<br><br></div>So my task is to get information from a user about their salary and then find their net salary and tax<br>deductions. I have seemingly worked everything fine until the part where I am supposed to tell them what tax Band they are in (i.e 1,2,3 or 4).<br>
</div>My code is like this:<br><br><br clear="all"><div><div><div><br></div><div>taxBAND = None<br>GrossSalary = None<br>costs = None<br>taxdeducted =None<br>netSalary = None<br>line ="-"*80<br>name =""<br>
<br><br><br><br>while not name:<br> name =raw_input("ENTER NAME HERE: ")<br>while not costs:<br> costs =float(raw_input("enter costs here: "))<br>while not GrossSalary:<br> GrossSalary= int(raw_input("enter your gross salary: "))<br>
<br>if (GrossSalary < 50000):<br> taxdeducted= 0.05*(GrossSalary -costs)<br> netSalary = GrossSalary - taxdeducted<br> while GrossSalary < 50000:<br> print taxBAND == 1<br><br>elif (GrossSalary >= 50000 and GrossSalary < 150000):<br>
taxdeducted = 0.1*(GrossSalary - costs)<br> netSalary = GrossSalary - taxdeducted<br> <br>print line<br>print "\t\t BURS STATEMENT: ",name<br>print line<br>print "Gross", "\t Costs", "\t Tax BAND", "\tTax Deducted", "\t Net Salary"<br>
print GrossSalary,"\t",costs,"\t\b",taxBAND,"\t",taxdeducted,"\t\t",netSalary<br>print line<br><br><br><br></div><div>I haven't put in the whole code because it's too long. I instead want to focus on the problem which can be found in the if section: print taxBAND == 1<br>
<br></div><div>I have tried all the different operators, from augmentation to logical to comparison, but I still get errrors. The errors I have acquired so far are:<br><br></div><div>1.<br>Traceback (most recent call last):<br>
</div><div>File "X:/xxx/Xxxx.py", line 30, in <module><br></div><div>taxBAND += 1<br></div><div>TypeError: unsupported operand type (s) for +=: 'NoneType' and 'int' <br><br>2.<br>Traceback (most recent call last):<br>
<div>File "X:/xxx/Xxxx.py", line 30, in <module><br></div><div>taxBAND = I<br></div><div>NameError: Name 'I' is not defined<br><br></div><div>(the first two errors were before i added the line "while GrossSalary < 50000:")<br>
<br></div><div>3.<br>Traceback (most recent call last):<br><div>File "X:/xxx/Xxxx.py", line 31, in <module><br></div><div>taxBAND += 1<br></div><div>TypeError: unsupported operand type (s) for +=: 'NoneType' and 'int' <br>
<br>4.<br>Traceback (most recent call last):<br><div>File "X:/xxx/Xxxx.py", line 31, in <module><br></div><div>taxBAND = I<br>NameError: Name 'I' is not defined</div></div><br></div><div>Regards,<br>
Tab<br></div><br></div></div></div></div>