1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Archy [21]
3 years ago
11

The function below takes one parameter: a string (date_string) containing a date in the mm/dd/year format. Complete the function

to return a list containing integers for each of the date components in month, day, year order. For example, if given the string '06/11/1930', your code should return the list [6, 11, 1930].
Computers and Technology
1 answer:
Natalija [7]3 years ago
8 0

Answer:

The solution code is written in Python 3.

  1. def convertDate(date_string):
  2.    date_list = date_string.split("/")
  3.    for i in range(0, len(date_list)):
  4.        date_list[i] = int(date_list[i])
  5.    return date_list  
  6. print(convertDate('06/11/1930'))

Explanation:

Firstly, create a function convertDate() with one parameter, <em>date_string</em>. (Line 1).

Next, use the Python string <em>split()</em> method to split the date string into a list of date components (month, day & year) and assign it to variable <em>date_list</em>. (Line 3) In this case, we use "/" as the separator.

However, all the separated date components in the <em>date_list</em> are still a string. We can use for-loop to traverse through each of the element within the list and convert each of them to integer using Python<em> int() </em>function. (Line 5 - 6)

At last return the final date_list as the output (Line 8)

We can test our function as in Line 11. We shall see the output is as follow:

[6, 11, 1930]

You might be interested in
.2. What approach to deviance do you find most persuasive: that
garik1379 [7]

Answer:

The description for the given question is described in the explanation section below.

Explanation:

Since deviance constitutes a breach of a people's current standard. I believe Erickson's psychological concept that Deviance becomes a trait that is commonly considered to need social control agencies' intervention, i.e. 'Something must being done'.

  • There most probably resulted whenever the rules governing behavior appear inconsistent in just about any particular frame.
  • Therefore the principle of this theory is that even in the analysis of deviance this same significant point seems to be the social community, instead of the participant.
8 0
3 years ago
12. In Justify the text is aligned both to the right and to the left margins, adding extra space between words as necessary *
Lena [83]

\blue{

\green{

Answer:

  • False

Explanation:

  • Because, aligment the tex are aligned in the centre of the page.

\pink{

\red{

4 0
3 years ago
Read 2 more answers
Windows Rights Management Services is used in conjunction with which Microsoft applications?
Mariana [72]
“Word” is your answer
6 0
3 years ago
Network Architecture and Topology: Mastery Test
trasher [3.6K]

Answer:

You need to understand all the network typologies and the devices that we use in the Computer networks. You also use the techniques like routing, masking, firewalls, VPN, as well as the network protocol. And recently added is the PKI. And hence you need to make sure that you know all these, and you should also know ipv4 and ipv6. Rest you can consult Tanenbaum for further studies on Computer Network.

Explanation:

Please check the answer.

4 0
3 years ago
There is no reason to study the works of famous photographers because they will make you less creative.
weeeeeb [17]
I think it is true because you may be ‘inspired’ by a famous artist but if you’re always being inspired by others its not 100% yours / you being creative
8 0
3 years ago
Read 2 more answers
Other questions:
  • How to eject a flash drive from chromebook?
    6·1 answer
  • Where is authorization management app on tablet?
    7·1 answer
  • Each tab is divided into groups of related commands or buttons. T or F
    10·1 answer
  • The computer has had far-reaching effects on our lives.how has the computer effected your life?
    8·1 answer
  • What is the correct process for selecting an entire row in a spreadsheet?
    8·2 answers
  • What is the importance of eliminating marks that classify a master key
    7·1 answer
  • What connectors are available for components to be connected externally to the motherboard
    12·2 answers
  • A musical time measurer is a(an)
    10·1 answer
  • The owner of a candle shop has asked for your help. The shop sells three types of candles as shown below:
    14·1 answer
  • Why are pirated software considered a threat?​
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!