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
To communicate with coworkers in the office
Elanso [62]

For effective communication to occur, everyone must trust and respect each other. ... Clear and concise communication will allow your colleagues to understand and then trust you. As a result, there will be more cooperation and less conflict in the workplace.

8 0
3 years ago
There is the Iphone MAX, Iphone XR and Iphone XS. which iphone is the very NEWEST and which one do you recommend? explain.
Pavlova-9 [17]

Answer:me myself would go with the Iphone XR

Explanation:

Because its like a combined phone of those two phones together and its not as exspnsive as the other phones and overall its good cause i have had it since it came out and had no problems with it.

3 0
2 years ago
Read 2 more answers
____ policy establishes criteria for classifying and securing the organization's information in a manner appropriate to its leve
pav-90 [236]

Answer:

Correct Answer is (d) Information sensitivity policy

Explanation:

Information sensitivity policy establishes the criteria for classifying and securing the organization's information in a manner that is appropriate to its level of security.

However, other options are incorrect. Server security can be established only on servers and on information/data that is in the server from unauthorized access. While VPN security is used for protecting network and encryption is used to encrypt data from illegal access.

However, only information sensitivity policy is used for classifying and securing organization information to the outside world.

The intention of information sensitivity policy:

The intention of using any information sensitivity policy is to help the employee to determine what information can be disclosed to non-employee, as well as the relative sensitivity of the information that should not be disclosed outside of the company without proper permission or authorization from supreme leadership of an organization.

7 0
3 years ago
The results of the SPEC CPU2006 bzip2 benchmark running on an AMD Barcelona has an instruction count of 2.389E12, an execution t
xxTIMURxx [149]

Answer:

inside a butt whole

Explanation:

3 0
2 years ago
Create pseudocode to compute the volume of a sphere. Use the formula: V= (4/3)* π r3 where π is equal to 3.1416 approximately, w
MA_775_DIABLO [31]

Answer:

In geometry, the area enclosed by a circle of radius r is πr2. Here the Greek letter π represents a constant, approximately equal to 3.14159, which is equal to the ratio of the circumference of any circle to its diameter.

Explanation:

3 0
2 years ago
Read 2 more answers
Other questions:
  • A/An is a series of instructions or commands that a computer follows; used to create software
    10·2 answers
  • Brute force attacks involve identifying a valid user account and then bombarding the server with an extensive:
    13·1 answer
  • Which of the following statements is true of intrapreneurs
    15·1 answer
  • How do you know if your phone has a virus?
    13·1 answer
  • In a chassis, the path along which air from a cool air source is conducted, past equipment to cool it, and then out of the rack.
    13·1 answer
  • What is a single-user computer?
    8·1 answer
  • Which expression is equivalent to 3x + 3x + 3x?<br><br> From Performance Matters
    11·2 answers
  • Jeri wants to make sure she designs her web site for a specific group of people. What will help her plan who will visit the site
    8·2 answers
  • An electronic element that stores data by changing its resistance based on the current that has passed through it (similar to RR
    5·1 answer
  • What is pseudocode? O A way of describing a set of instructions in text form using plain english O A diagrammatic representation
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!