Question: Exercise 3 Write a function called date(d) that takes a single string d as input which represents a date. The input string will always look

 Exercise 3 Write a function called date(d) that takes a single

Exercise 3 Write a function called date(d) that takes a single string d as input which represents a date. The input string will always look like "dd/mm/yyyy", where dd is the day, mm is the month and yyyy is the year. The function then prints out the date in three(3) different formats: format 1: mm/dd/yyyy format 2: yyyylmm/dd format 3: 'dd-mm-yy The last format uses dashes instead of slashes to separate the numbers and only uses the last 2 numbers from the year. For example, calling date("27/02/2003" will print to the screen 02/27/2003 2003/02/27 27-02-03 You do not need to convert any part of the input string into a number. The input string is always fedg ad as the same structure. Ue sing sicing to solve this. Redo exercise 3 using the split() method we saw in class instead of using string slicing to accomplish the same task

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!