More python

Ok added some more features to my program

 

#!/usr/bin/env python
# 24.03.2013

from datetime import datetime
import string
import time
now = datetime.now()

#get month
month = now.month

if now.month == 1:
print “January”, + now.year
elif now.month == 2:
print “February”, + now.year
elif now.month == 3:
print “March”, + now.year
elif now.month == 4:
print “April”, + now.year
elif now.month == 5:
print “May”, + now.year
elif now.month == 6:
print “June”, + now.year
elif now.month == 7:
print “July”, + now.year
elif now.month == 8:
print “August”, + now.year
elif now.month == 9:
print “September”, + now.year
elif now.month == 10:
print “October”, + now.year
elif now.month == 11:
print “November”, + now.year
else:
print “December”, + now.year

firstname = raw_input(“what is your firstname? “)
surname = raw_input(“what is your surname? “)
birthyear = raw_input(“what year were you born in ? ” )
sp = ” ”
print birthyear
print now.year
print
print “hello, ” + firstname + sp + surname
print
print “your name length ”
print len(firstname) + len(surname)
#convert ascii input to a integer
birthyear = string.atoi(birthyear)
#perform operation on the integer
age = now.year- birthyear
print “your age is”, age

if age <= 17:
print “you are a child”
else:
print “you are an adult”

essentially it tells you the date at the start,  can tell you hold old you are (based on current year – year of birth) and can work out what month it is by the output given by datetime.