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
Hello 10 points if my Chromebook is on 26 percent how much time do I have left theoretically
velikii [3]
About 15 minutes.......
7 0
3 years ago
Read 2 more answers
This is used in a program to mark the beginning or ending of a statement, or separate items in a list:_____
hammer [34]

Answer:

B) Punctuation

Explanation:

Punctuation are greatly used in different programming languages for different purposes. In the Java, C++ and C# Programming languages for example, two popular punctuation marks are the comma (,) and semi-colon (;). The comma is used for separating elements of a list and arrays, while the semi-colon indicates end of an executable statement or line of code. Other popular punctuation marks used in programming are periods (dot), question marks, parenthesis angle brackets and braces each implementing a specific grammatical syntax in the language.

5 0
3 years ago
refers to a problem-solving approach that requires defining the scope of a system, dividing it into its components, and then ide
lilavasa [31]

Answer:

D. System Analysis

Explanation:

System analysis can be defined as the process of analysing a problem in order to the know the cause thereby finding a way to resolve it or finding a solution to it.

System analysis enables us to easily study procedure or process thereby identifying what the objective of the procedures is which will in turn help to achieve what we needed to achieve.

System analysis is important because it enables easier identification of a problem which make us to find the best way to solve the problem since it is a problem solving technique which ensures that all problem are been resolved accurately and efficiently

6 0
3 years ago
Which of the following statements is false?
mart [117]

Answer:

3 is true others are false

3 0
2 years ago
Read 2 more answers
Write a SELECT statement that returns the same result set as this SELECT statement. Substitute a subquery in a WHERE clause for
AleksAgata [21]

Answer:

SELECT DISTINCT VendorName FROM Vendors

WHERE VendorName= ANY (SELECT VendorName FROM Vendors JOIN Invoices ON Vendors.VendorID = Invoices.VendorID) ORDER BY VendorName;

Explanation:

All bold faced words are sql keywords for different purposes. The subquery return the all values which matches the join condition  and main query will choose only distinct values and make them in order of VendorName.

There many other queries also return the same result as returned by given query.

8 0
2 years ago
Other questions:
  • Alicia is a dietitian. She gives other people suggestions for nutrition. She wants to organize a large amount of data concerning
    13·1 answer
  • Which software product release category is "generally feature complete and supposedly bug free, and ready for use by the communi
    7·1 answer
  • Imagine that you have a friend who has expressed interest in designing and programming video games. He loves to play video games
    10·1 answer
  • Question 6 of 10
    11·1 answer
  • Explain two ways by which the calendar meets or fails to meet the criteria of showing the correct data
    7·1 answer
  • Design the following webpage using suitable html code .
    11·2 answers
  • WILL GIVE BRAINLEIST PLZ HELP PLZ AND THANK YOU
    7·1 answer
  • Calculate the resistance of an unknown resistor in a circuit with 30 volts and 6 amps. The formula is R = V/I.
    6·1 answer
  • What is the half of 3/18
    6·1 answer
  • Explain why you would use the soft on/off jumper when working on ATX system
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!