Question: IN PYTHON The Aland Islands use both a short form and long for for expressing dates, as follows: Short format: yyyy-mm-dd numerical used for month

IN PYTHON

The Aland Islands use both a short form and long for for expressing dates, as follows:

Short format: yyyy-mm-dd numerical used for month and day -- TWO DIGITS used for all months & days (ie. 02) EXAMPLES: 1999-12-07 1999-01-21

Long format: d mmmm yyyy numerical form for day, full name for month - SINGLE DIGIT used for all days < 10 (ie 2, 23) EXAMPLES: 3 December 1999 23 January 1998

You are to write a program which converts Aland dates between short form to long form, and vice versa.

The program will repeat the following until the user wishes to exit:

* ask the user which format they will be entering (S - short or L - long)

* accept the short or long date (as one string) from user input * output the date in the opposite form (short -> long, long -> short)

YOUR PROGRAM SHOULD:

* have a function to_short(date) , which accepts one parameter, a short date string, and outputs long version of that date

* have a function to_long( date), which accepts one parameter, a long date string, and outputs short version of that date

* any other function that you think might be helpful

* remove leading, trailing and embedded blanks from the input string

* place all function in a SEPARATE module that is used by your main process.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!