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

  Compare the performance of the addedge methods

Then repeat Project 2, using your revised DirectedGraph. Compare the performance of the addEdge methods in this implementation of an undirected graph versus the implementation possible under the assumptions of Project 2.

  Prove or disprove that available expressions

Prove or disprove that available expressions (Exercise 8) is a distributive data flow problem.

  What is the worstcase cost for an equality search

If the hash function distributes data entries over the space of bucket numbers in a very skewed (non-uniform) way, what can you say about the space utilization in data pages?

  Display the lowest number of moves

Display the lowest number of moves it took for the mole to escape and how many times did the mole escape in that fewest number of moves?

  Hesitant to adopt cloud computing

Research the Internet for reasons why some companies are hesitant to adopt cloud computing. What are some of the reasons you found? Do you think these are legitimate concerns? Why or why not? Be sure to cite your sources.

  Do you think windows will continue to be a player in market

Do you think that would the development differences between iOS and Android that it would be hard for a person to be a master in each operating system? Or is it better to try and master 1 of the 2 (or 3 if you take into account Windows)?

  Residual error rate for a communication line

If no error detection mechanism is used, the residual error rate for a communication line using 9-bit frames is approximately will be and what would be the result?

  Most attractive financially

From a Net Present Value perspective, which of the two projects is most attractive financially? Show all work for full/partial credit.

  What is the asymptotic complexity of the following function

What is the asymptotic complexity of the following function and how did you arrive to this answer.

  Find a linear regression equation for the linearized data

The distance that a person can see from an airplane depends on the altitude of the airplane, as shown in the table below.

  Estimate the standard deviation of the mean value

Calculate the mean and standard deviation for the sample, and estimate the standard deviation of the mean value

  What is the frequency of its third harmonic

What is the total average power for a commercial AM transmitter with an un-modulated carrier power of 20 kW and 100% modulation - What is the frequency of its third harmonic?

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