Define a function datetonum

Assignment Help Basic Computer Science
Reference no: EM132184077

Define a function  dateToNum(..) which receives as parameter a string representing a date in the format:

"d-mmm-yy", "d-mmm-y", "dd-mmm-yy" or "dd-mmm-y"  (for example "2-Jan-18", "5-Jan-8", "25-Dec-17", "21-Apr-1")

(that is, the days and the years may be represented with one or two digits, the month with the first three letters of the month name (starting with uppercase and rest lowercase).

The function should return a list with three numbers: [y,m,d].

Considering the examples, respectively the list returned would be [2018,1,2] , [2008,1,5], [2017,12,25], [2001,4,21]

(that is, the year is assumed 2001 or later)

As an example, the following code fragment:

st = "2-Jan-18"

print(dateToNum(st))

should produce the output:

[2018, 1, 2]

Program language: python

Reference no: EM132184077

Questions Cloud

Write a program to determine the length of bursts of zero : Write a program to determine the length of bursts of zero's in a list of N numbers stored in an List. The program should record the length of the bursts of zero
Three skills connect with different levels of management : Define technical skills, human skills, and conceptual skills. How do these three skills connect with the different levels of management?
Was it technology that drove this change or was it business : Information technology has changed business as companies compete globally and are pressured to provide quality, speed, and customer service.
Identify business leader who you admire in your community : Not every great business leader is a big talker, but most are excellent communicators. Identify a business leader who you admire in your community.
Define a function datetonum : Define a function dateToNum(..) which receives as parameter a string representing a date in the format:
Human resource management in international market : How would the economic system affect the company GOOGLE human resource management in international market.
Construct a tracking portfolio for the option : Consider a European put option on a non-dividend paying stock with strike price $31 and time to expiration 4 months. Construct a tracking portfolio for option
The importance of change management : You are a project manager and believe that your initiative would be more successful if you had a change manager on your team.
Examine the organizational structure of your company : Examine the organizational structure of your company and suggests ways it can be changed to improve the overall profitability.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Program based on series to display a juggler sequence

All user input for this program will be need to be positive, non-zero values. So you will write a user-defined function to read positive, non-zero input from the user. The userdefined function requirements are: o The prompt for user input will be ..

  Booting to a corporate windows image

You have multiple people who work from their own home offices. Your manager decides that these users can use their own personal computers

  Magnetism and electromagnetism

Discuss the difference between a permanent magnet and an electromagnet.  What are some practical applications of each? Discuss why a conductor and the external field must be perpendicular to each other to have motor action or to generate induced vol..

  Determine the information technology/security gaps

Determine the information technology/security gaps and develop a security strategy that includes issues relating to confidentiality

  Determine the value produced at the primary output

For each of the four possible combinations of inputs applied to the two primary inputs of this circuit, determine the value produced at the primary output. Is there a simpler circuit that gives the same input/output behavior?

  Why is it important to test a disaster recovery plan

Answer each of the following questions with at least 300 words each. 1) Why is it important to test a disaster recovery plan? 2) In your opinion, is there such a thing as a 'failed' disaster recovery test?

  Concepts of excludability and rivalry in consumption

Using the concepts of excludability and rivalry in consumption, describe the public good. Is it a perfect or imperfect public good? Explain.

  Identify which items are classes

Identify which items are classes, which items are attributes and which items are methods;

  Problem regarding the stimulus-response

The relation between the magnitude of a sensation y and the magnitude of the stimulus x is given by

  What ways itplanning help managers control situation

In what ways does IT planning help managers exercise control in a situation? Does IT impact the truck driver of a company who delivers supplies to its customer

  What is a privacy impact assessment

1. What is a privacy impact assessment (PIA)? 2. Name and briefly describe 3 "best" practices for federal government IT managers who are charged with preparing a PIA.

  Represent important understandings of identity and worldview

Flags have significant symbolic meaning in a culture and represent important understandings of identity and worldview. Explain how flags represent cultural patterns and characteristics. Explain their influence on your personal connection to a cult..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd