Alan, the last two paragraphs you wrote is classic. Very, very true. LOL.
Ken
On 01/16/2011 07:32 PM, Alan Gauld wrote:
Python is so tempormential what is wrong with my code?
Python is not temperamental, it is just doing exactly what you ask it
to do.
It makes no judgement about whether
> minus_weekends=hourly_income*64
> total_income=int(minus_weekends-sum_of_monthly)
Here's problem number 1 - you're taking the values the wrong way around :)
It should be total_income=int(sum_of_monthly-minus_weekends)
> sum_of_monthly=int(yearly_income/12)
Here's the second problem
"walter weston" wrote
def income_report(yearly_income,hourly_income):
sum_of_monthly=int(yearly_income/12)# his yearly income dividing
by 12.
minus_weekends=hourly_income*64
total_income=int(minus_weekends-sum_of_monthly)
return sum_of_monthly,total_income
When you divide you
Heres my code:
def income_report(yearly_income,hourly_income):
""" this will count the average of your total monthly income"""
sum_of_monthly=int(yearly_income/12)# his yearly income dividing by 12.
minus_weekends=hourly_income*64 #the 64 is the two days off for the
weekend(assuming