Re: [Tutor] simplifying with string-formatting operator

2005-09-23 Thread Pujo Aji
hello,   you can use this model:     day, month, year = input("Please enter the day, month and year numbers: ")     date1 = '%s/%s/%s' % (month, day, year)     months = {1:"January", 2:"February", 3:"March", 4:"April", 5: "May", 6: "June", 7: "July", 8: "August", 9: "Septe

Re: [Tutor] simplifying with string-formatting operator

2005-09-23 Thread paul brian
I would suggest you use the built in datetime modules or egenix mx.DateTime. for example >>> import datetime >>> year = "05"; month="09";day="23" >>> dateobj = datetime.date(int(year)+2000, int(month), int(day)) >>> dateobj.strftime("%A %B %y") 'Friday September 05' >>> obviously you need to loo

[Tutor] simplifying with string-formatting operator

2005-09-23 Thread Goofball223
Hello Does anyone have any idea on how i could simplify the following program by using strings? # dateconvert2.py #    Converts day month and year numbers into two date formats import string def main():    # get the day month and year    day, month, year = input("Please enter the day, month a