hi. i'm very new to python. just started looking at some online amateur guides for fun a few days ago. anyways, today i was sitting here staring at the wall, and i decided to make probably the most useless script ever.
what you do is, you type in the day of the month, the month and the year you were born, and the current day of the month, month and year, and it calculates your age, or whoever's information you wrote in. useless. utterly useless. :D
ive been tinkering on it a bit, and ive come down to one last problem. heres what ive made:
so my problem is i cant figure our how to make g appear in the print. ive tried a few things, but since i hardly know anything about python at this time, i'm turning to you for help.
and as ive said, i'm a complete amateur so no need to commend the fact that my script probably blows.
:)
what you do is, you type in the day of the month, the month and the year you were born, and the current day of the month, month and year, and it calculates your age, or whoever's information you wrote in. useless. utterly useless. :D
ive been tinkering on it a bit, and ive come down to one last problem. heres what ive made:
Code:
a = 9 #day of the month you were born
b = 11 #month you were born
c = 1990 #year you were born
d = 20 #today's day of the month
e = 5 #this's month
f = 2007 #this year
if c > f:
print 'you have written a faulty birth date or current date, please try again.'
if b == e and c == f:
g = (f-c)
print 'congratulations, today is your birthday. today you turn (g).'
if e > b:
g = (f-c)
print 'You are (g) years old.'
if b > e:
g = (f-c-1)
print 'you are (g) years old.'
if b == e and a > d:
g = (f-c-1)
print 'you are (g) years old.'
if b == e and d > a:
g = (f-c)
print 'you are (g) years old.'
and as ive said, i'm a complete amateur so no need to commend the fact that my script probably blows.
:)
Comment