Tuesday, 15 July 2014

logic - calculating age of a person in logical way in python without using built in functions -



logic - calculating age of a person in logical way in python without using built in functions -

date=raw_input("enter date:") month=raw_input("enter month:") day=raw_input("enter day:") date1=raw_input("enter date:") month1=raw_input("enter month:") day1=raw_input("enter day:") int(date,month) int(date1,month1) int(day,day1) d=date1-date m=month1-month da=day1-day print d,m,da

trying programme getting error integer required

the int() function doesn't work that:

firstly, takes 1 argument (the sec optional , base, irrelevant in case). secondly, need assign result variable.

thus

int(date,month)

should be

date = int(date) month = int(month)

and on.

python logic

No comments:

Post a Comment