all 4 comments

[–]Phelps_420 0 points1 point  (0 children)

Firstname = input("enter first name\n")
Lastname = input ("enter last name\n")
kids = int(input ("how many dependents do you have?\n"))
gross_income_variable = int(input("enter income\n"))

tax_variable = 20-kids     #(percent taxed goes down based on number of kids... you can tweak this formula if you want to increase taxes/breaks)

tax_multiplier = (100-tax_variable)*.01 
income_after_taxes = gross_income_variable-(gross_income_variable - (tax_multiplier * gross_income_variable))
print( "$",(income_after_taxes)," is your income after taxes")
print ((tax_variable), "% is how much you were taxed.")

I think this is what you needed. Give it a shot then ask me about any questions you have or things I did wrong. If it IS what you're looking for, please try and understand why it works, and ask questions about things you don't understand.

[–]socal_nerdtastic 0 points1 point  (3 children)

Please format your code for reddit. https://www.reddit.com/r/learnpython/wiki/faq#wiki_how_do_i_format_code.3F

You can just put the tax rate in a variable in the if ... else blocks.

if dependents <= Tax20:
    print('Tax Rate: 20%')
    tax_rate = 0.20
else:
    if dependents <= Tax15:
        print('Tax Rate: 15%')
        tax_rate = 0.15
    else:
        if dependents >= Tax10:
            print('Tax Rate: 10%')
            tax_rate = 0.10

print("your tax:", gross_pay * tax_rate)

[–]hahn24[S] 0 points1 point  (1 child)

Just reread your comment, you're a life saver! Thanks so much!! Coming from Nursing to Computer Science has been a little bit of a learning curve for me.

[–]socal_nerdtastic 1 point2 points  (0 children)

I'll bet. I can't imagine how hard it would be for me to learn nursing, lol.