You are viewing our Forum Archives. To view or take place in current topics click here.
Feedback? my first python script
Posted:
Feedback? my first python scriptPosted:
Status: Offline
Joined: Jul 20, 201212Year Member
Posts: 5
Reputation Power: 0
Status: Offline
Joined: Jul 20, 201212Year Member
Posts: 5
Reputation Power: 0
This is the first python script that iv made out of my own will.
please let me know if it okay for my first time.
its used as a tax calculator for paychecks where i live.
--------------------------------------------------------------
#Hope the best for you all Enjoy
print 'If you dont already know how, to start the script just enter in "Pay()"\n'
print '\n Ohh also i forgot to mention i never did add anything to round the numbers to the nearest .00 so sorry about that.\n'
def Pay():
print 'Disclaimer';
print 'Please note that some info may or may not be correct.\n but is most likely right ';
print;
print;
print ' [1] Show Fed tax?\n [2] Show Medicare tax?\n [3] Show FICA Tax?\n [4] Show State Tax?\n [5] Show all together?';
Tax = input('Chose one\n')
if (Tax == 1):
Federal();
elif (Tax == 2):
Medicare();
elif (Tax == 3):
FICA();
elif (Tax == 4):
State();
elif (Tax == 5):
All();
else:
print 'not valid. please type Pay() again and choose a different option';
#---------------------v-biweekly-v---------------------------------------------------------
def Federal():
Wage = input('Enter your hourly wage.\n');
Hours = input('Enter amount of hours you worked.\n');
BeforTax = Wage * Hours;
FedTax = BeforTax * .057841;
AfterTax = BeforTax - FedTax;
print 'Befor Taxs your check is', BeforTax;
print 'You lost', FedTax, 'from your tax';
print '\nAfter Federal tax your check is', AfterTax;
print;
print 'Thanks for using this ';
def Medicare():
Wage = input('Enter your hourly wage.\n');
Hours = input('Enter amount of hours you worked.\n');
BeforTax = Wage * Hours;
Medicare = BeforTax * .01446;
MediTax = BeforTax - Medicare;
print 'Befor Taxs your check is', BeforTax;
print 'you lost', Medicare, 'from your tax';
print '\nAfter Federal tax your check is', MediTax;
print;
print 'Thanks for using this ';
def FICA():
Wage = input('Enter your hourly wage.\n');
Hours = input('Enter amount of hours you worked.\n');
BeforTax = Wage * Hours;
fica = BeforTax * .04205;
FICATax = BeforTax - fica;
print 'Befor Taxs your check is', BeforTax;
print 'you lost', fica, 'from your tax';
print '\nAfter Federal tax your check is', FICATax;
print;
print 'Thanks for using this ';
def State():
Wage = input('Enter your hourly wage.\n');
Hours = input('Enter amount of hours you worked.\n');
BeforTax = Wage * Hours;
State = BeforTax * .014601;
StateTax = BeforTax - State;
print 'Befor Taxs your check is', BeforTax;
print 'you lost', State, 'from your tax';
print '\nAfter Federal tax your check is', StateTax;
print;
print 'Thanks for using this ';
def All():
Wage = input('Enter your hourly wage.\n');
Hours = input('Enter amount of hours you worked.\n');
BeforTax = Wage * Hours;
FedTax = BeforTax * .057841;
Medicare = BeforTax * .01446;
fica = BeforTax * .04205;
State = BeforTax * .014601
AllTax = FedTax + Medicare + fica + State;
TotalTax = BeforTax - AllTax;
print 'Befor Taxs your check is', BeforTax;
print '\nYou lost', FedTax, 'to Federal tax';
print 'You lost', Medicare, 'to Mediacare tax';
print 'You lost', fica, 'to FICA tax';
print 'you lost', State, 'to State tax';
print '\nYou lost', AllTax, 'from your taxs';
print '\nWith all taxs added you made', TotalTax;
print;
print 'Thanks for using this '
please let me know if it okay for my first time.
its used as a tax calculator for paychecks where i live.
--------------------------------------------------------------
#Hope the best for you all Enjoy
print 'If you dont already know how, to start the script just enter in "Pay()"\n'
print '\n Ohh also i forgot to mention i never did add anything to round the numbers to the nearest .00 so sorry about that.\n'
def Pay():
print 'Disclaimer';
print 'Please note that some info may or may not be correct.\n but is most likely right ';
print;
print;
print ' [1] Show Fed tax?\n [2] Show Medicare tax?\n [3] Show FICA Tax?\n [4] Show State Tax?\n [5] Show all together?';
Tax = input('Chose one\n')
if (Tax == 1):
Federal();
elif (Tax == 2):
Medicare();
elif (Tax == 3):
FICA();
elif (Tax == 4):
State();
elif (Tax == 5):
All();
else:
print 'not valid. please type Pay() again and choose a different option';
#---------------------v-biweekly-v---------------------------------------------------------
def Federal():
Wage = input('Enter your hourly wage.\n');
Hours = input('Enter amount of hours you worked.\n');
BeforTax = Wage * Hours;
FedTax = BeforTax * .057841;
AfterTax = BeforTax - FedTax;
print 'Befor Taxs your check is', BeforTax;
print 'You lost', FedTax, 'from your tax';
print '\nAfter Federal tax your check is', AfterTax;
print;
print 'Thanks for using this ';
def Medicare():
Wage = input('Enter your hourly wage.\n');
Hours = input('Enter amount of hours you worked.\n');
BeforTax = Wage * Hours;
Medicare = BeforTax * .01446;
MediTax = BeforTax - Medicare;
print 'Befor Taxs your check is', BeforTax;
print 'you lost', Medicare, 'from your tax';
print '\nAfter Federal tax your check is', MediTax;
print;
print 'Thanks for using this ';
def FICA():
Wage = input('Enter your hourly wage.\n');
Hours = input('Enter amount of hours you worked.\n');
BeforTax = Wage * Hours;
fica = BeforTax * .04205;
FICATax = BeforTax - fica;
print 'Befor Taxs your check is', BeforTax;
print 'you lost', fica, 'from your tax';
print '\nAfter Federal tax your check is', FICATax;
print;
print 'Thanks for using this ';
def State():
Wage = input('Enter your hourly wage.\n');
Hours = input('Enter amount of hours you worked.\n');
BeforTax = Wage * Hours;
State = BeforTax * .014601;
StateTax = BeforTax - State;
print 'Befor Taxs your check is', BeforTax;
print 'you lost', State, 'from your tax';
print '\nAfter Federal tax your check is', StateTax;
print;
print 'Thanks for using this ';
def All():
Wage = input('Enter your hourly wage.\n');
Hours = input('Enter amount of hours you worked.\n');
BeforTax = Wage * Hours;
FedTax = BeforTax * .057841;
Medicare = BeforTax * .01446;
fica = BeforTax * .04205;
State = BeforTax * .014601
AllTax = FedTax + Medicare + fica + State;
TotalTax = BeforTax - AllTax;
print 'Befor Taxs your check is', BeforTax;
print '\nYou lost', FedTax, 'to Federal tax';
print 'You lost', Medicare, 'to Mediacare tax';
print 'You lost', fica, 'to FICA tax';
print 'you lost', State, 'to State tax';
print '\nYou lost', AllTax, 'from your taxs';
print '\nWith all taxs added you made', TotalTax;
print;
print 'Thanks for using this '
You are viewing our Forum Archives. To view or take place in current topics click here.