# # computes approximately how many days # you have lived w/o considering partial # or leap years. # # shows use of CONSTANT and string function # # example of basic while-loop # # written by e.bonakdarian oct 2009 # from string import capitalize DAYS_IN_YEAR = 365 print 'Program will compute approximately how old you are in days' print '(without considering partial or leap years)' print stop = False while (not stop): name = raw_input('What is your name? ') age = input('How old are you (in years)? ') days_lived = age * DAYS_IN_YEAR print ('Dear %s, you are approximately %d days old.' % (capitalize(name), days_lived)) answer = raw_input('\nEnter "x" to stop: ') if answer == 'x': stop = True print '\nEnding program\n' raw_input(' to exit')