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]
2 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]2 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
What is the difference of expository and reflexive documentary
spayn [35]
The reflexive documentary mode focuses on the relationship between the filmmaker and the audience. While expository documentaries set up a specific point of view or argument about a subject and a narrator often speaks directly to the viewer.
3 0
2 years ago
16.
dimaraw [331]
  • Answer:

<em>r = 15 cm</em>

  • Explanation:

<em>formula</em>

<em>V = πr²×h/3</em>

<em>replace</em>

<em>4950 = 22/7×r²×21/3</em>

<em>4950 = 22/7×r²×7</em>

<em>4950 = 22×r²</em>

<em>r² = 4950/22</em>

<em>r² = 225</em>

<em>r = √225</em>

<em>r = √15²</em>

<em>r = 15 cm</em>

3 0
2 years ago
You have purchased a printer that has the capability to print in duplex mode so that users can print on both sides of a sheet of
fiasKO [112]

If you have purchased a printer that has the capability to print in duplex mode so that users can print on both sides of a sheet of paper. However, when users try to use this capability when they send a print job, documents are still printed on only one side. Then there might be a problem with (d) THE DUPLEX MODE NEEDS TO BE ENABLED ON THE DEVICE SETTINGS TAB IN THE PRINTER'S PROPERTIES.

Explanation:

  • If the duplex mode isn't enable on the printer setting, then the printer is still going to read that the output should come in a single page and not in the duplex mode.
  • When facing such a problem, the user should go to the "Device Settings" tab in the printer properties and change the required settings to print according to the users needs.

7 0
3 years ago
What two things should you do before starting the design process
Charra [1.4K]

Answer: B and C

Explanation: Analyze the audience

                      Identify the problem

8 0
2 years ago
Create an absolute value component abs() with an 8-bit input A that is a signed binary number, and an 8-bit output Q that is uns
Stolb23 [73]

Answer:

Explanation:

Find attached the solution

5 0
3 years ago
Other questions:
  • La inteligencia o unidad lógica de un computador se denomina como??? Software, Hardware CPU o que, ayuda.....
    7·1 answer
  • A firewall is either software or dedicated hardware that exists between the __________ being protected.
    13·1 answer
  • Im being timed please help!!
    7·2 answers
  • A computer has 9850 processes and 172 of them where suspended while 276 were terminated.,explain why some of the processes where
    15·1 answer
  • A _________ is automatically launched by some trigger and appears in front of the active window
    12·1 answer
  • How would you define the rule of thirds?
    11·1 answer
  • Which is an aspect of structural-level design?
    6·2 answers
  • The stack pop operation
    10·1 answer
  • The quicksort pivot value should be the key value of an actual data item; this item is called the pivot. True or False?
    11·1 answer
  • Five year ago, Amit was three times as old as Arman. Ten years later Amit would be twice as old as Arman. How old is Arman now? 
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!