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
Which member of the restaurant and food/beverage service career is mostly likely to plan menus and direct worker
kumpel [21]

What are the options for the question

5 0
3 years ago
Read 2 more answers
In symmetric encryption the same key is used to encrypt and decrypt a message. in asymmetric encryption different keys are used
Brrunno [24]

A useful advantage of Asymmetric encryption over symmetric encryption is that there is no secret channel necessary for the exchange of the public key, unlike in the symmetric encryption which requires a secret channel to send the secret key.  

Another advantage of Asymmetric encryption is that is has increased security. Asymmetric uses two different keys (Public and private) for both encryption and decryption of data while symmetric uses one.

5 0
3 years ago
Read 2 more answers
Bluetooth is a common wireless protocol used to make pan connections. <br> a. True <br> b. False
Minchanka [31]
 a. True  This  is because it covers only a short distance  and allows  sharing of data between short distances(PAN) 
5 0
3 years ago
Universal Containers has a requirement to integrate Salesforce with an external system to control record access. What option sho
Inessa05 [86]

Answer:

C. Use the SOAP API to maintain the related SObject_share records

8 0
3 years ago
What technology allows you to hide the private IP address of a system from the Internet?a. SSLb. RADIUSc. PPTPd. NAT
Greeley [361]

Answer:

The answer is "Option d".

Explanation:

In networking, NAT refers to the Network Address Translation. This process is used to translate computer IP addresses into a single IP address in your local network. It allows private IP networks to connect to the Internet using unregistered IP addresses. and other options are incorrect that can be described as follows:

  • In option a, SSL stands for Secure Sockets Layer. It is used in transmission of documents or data over a network that's why it is not correct.
  • In option b, RADIUS stands for Remote Authentication Dial-In User Service. It is used to manage the data on a network.
  • In option c, PPTP stands for Point-to-Point Tunneling Protocol. It is used to provide a set of rules for communicating through a network that's why it is not correct.

6 0
3 years ago
Other questions:
  • Guys i really need help pleasure?
    7·2 answers
  • . If you have written the following source code:
    9·1 answer
  • Without entering into the internet cloud or intranet cloud, how many icons in the topology represent endpoint devices (only one
    6·1 answer
  • You work for a company that is growing. Originally, all the users in all departments had access to all the data in the database.
    6·2 answers
  • ECG mashine is an example of
    12·1 answer
  • Rainfall_mi is a string that contains the average number of inches of rainfall in Michigan for every month (in inches) with ever
    12·1 answer
  • Ile 1 cm<br> ?<br> 50 m<br> The an
    5·2 answers
  • Help me find the difference between these logos
    10·2 answers
  • Please answer.
    9·1 answer
  • ...............is a personal computer that fits on desk.​
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!