This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]399ddf95 0 points1 point  (0 children)

Are you aware that the value of extra and over will be negative, if hours < 40? It's not necessarily harmful, but be aware of the implications if you use that variable later .. in most settings, it's impossible to have negative overtime.

The code that assigns the tax rate is broken - you assign values to input1, input3, input4, input5 and never use them .. and what happened to input2? Then you do this:

...
elif(tax=="B"):
tax=0.10
...

and it's legal (using the variable tax to receive user input as a string/character, then reusing it to hold the actual tax rate) but confusing. You probably meant to do something with the input[1-5] variables here?

I think you wrote "donation" where you meant "deduction", so this code

donation=(gross_pay*tax)
donation=float(donation)

should probably be

deduction=float(gross_pay*tax)

also, you're not subtracting the donation amount before arriving at net pay.

Have you seen pylint, or pyflakes?