Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
I just started using python a few weeks ago. This is my first program. You input your income and what percent you want to save then it tells you how much to put away. The the code works, but it puts in the word "none" after it calls the function. Is the call sytax incorrect? I'd appreciate any feedback you could offer :-).
# savings.py 09-14-03
print "Hello, welcome to my savings program."
print "I will ask you a few questions then calculate"
print "the info and give you a plan of action."
first_name = raw_input("What is your first name? ")
last_name = raw_input("What is your last name? ")
income = input("How much do you make a year after taxes? ")
percent = input("What percent of your income do you want to put aside? ")
weekly_income = income/52
def compute(income, percent):
result = income*percent/100
print "Ok,",first_name + " " + last_name
print "This is how much you should put away a week:"
print "$",compute(weekly_income, percent)
print "If you stick to this you will go places!!!"
0 · ·