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

Concept of computable function

Church's thesis equates the concept of computable function" with those functions computable by, for example, Turing machines. Which of the following is true of Church's thes

What must jack earn in the fifth month

During the first four months of the year, Jack earned $1320, $800, $1340, and $530. If Jack must have an average salary of at least $960 in order to earn retirement benefits

Summarise three functions carried out by this professional

Submit a paper in which you address the concept of ‘professional bodies' as it relates to the technology industry. To do this, first explain what is meant by ‘professional b

What is the effective memory access time

Assume that 80 percent of the accesses are in the associative memory and that, of those remaining, 10 percent (or 2 percent of the total) cause page faults. What is the effe

Implementation plan expansion

Expand your application or site to include input form(s)--such as a change control request, a support ticket request, a test or bug report, a training request, or a contact

Calculate percentage bandwidth that is used for guardbands

A satellite with twelve 36-MHz bandwidth transponders operates in the 6/4-GHz bands with 500 MHz bandwidth and 4-MHz guardbands on the 4-GHz downlink, as shown in Fig. 8-10.

What is the probe effect

Discuss the different steps that must be taken to investigate a real-world phenomenon by a formal method. Which one of these steps can be formalized, which cannot? What is t

Security code review for embedded system

1. Briefly discuss how a security code review for an embedded system would be similar to and different from a security code review of a Web application containing the same n

Reviews

Write a Review

 
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