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
navik [9.2K]
3 years ago
13

Write a program that reads a string from the user containing a date in the form mm/dd/yyyy. If the user entered 12/10/2019, then

it should print the date in the form December 10, 2019. solution in python.
Computers and Technology
1 answer:
Brrunno [24]3 years ago
4 0

Answer:

months = ["January","February","March","April","May","June","July","August","September","October","November","December"]

date = input("mm/dd/yyyy: ")

splitdate = date.split("/")

print(months[int(splitdate[0])-1]+" "+splitdate[1]+", "+splitdate[2]+".")

Explanation:

This line initializes a list of all 12 months

months = ["January","February","March","April","May","June","July","August","September","October","November","December"]

This prompts the user for date

date = input("mm/dd/yyyy: ")

This splits the date into three parts; mm with index 0, dd with index 1 and yy with index 2

splitdate = date.split("/")

The following prints the required output

print(months[int(splitdate[0])-1]+" "+splitdate[1]+", "+splitdate[2]+".")

Analyzing the print statment

splitdate[1] represents the day of the date

splitdate[2] represente the month of the date

However, in <em>months[int(splitdate[0])-1]</em>

First: splitdate[0] represents the month of the year as a string in numeric form e.g. "12", "01"

It is first converted to an integer as: int(splitdate[0])

Then the corresponding month is derived from the month list

You might be interested in
What is one of the first power tools you’ll need as electrician
Svetlanka [38]

I'd say a drill and a flashlight

7 0
3 years ago
From the philosophical standpoint, especially in the discussion of moral philosophy or ethics, why do we consider “murder” or “k
wlad13 [49]

Explanation:

Morality is a set of values ​​and habits that a society acquires over time and can be categorized as good and bad values, right and wrong, justice and crime. Ethics is defined as the study of morals, the practical application of moral behaviors defined by society.

Therefore, the concept of "murder" or "killing" is seen as an immoral act by the vast majority of society around the world, strengthened by the set of moral conduct common to all human beings, which are the Articles on the Universal Declaration of Human Rights. Human Rights, which is an official document of the UN, which contains several universair and analytical rules on the rights of every individual, such as the right to life, security, freedom, etc.

7 0
3 years ago
Test if the word mold is stored in the variable word. Computer science.
Andre45 [30]

Answer:

word = str("Enter a word: ")

if "mold" in word:

 print("Mold is in the variable word.")

else:

 print("Mold is not in the variable word.")

5 0
3 years ago
True or False <br> Hebrew Bible and the Koran were first written in English.
lilavasa [31]

Answer:

<h2>FALSE </h2>

THE TWO HOLY BOOK, QUR AN AND HEBREW BIBLIE WAS WRITTEN IN THEIR NATIVE LANGUAGES, FOR EXAMPLE, KORAN IS WRITTEN IN ARABIC AND THE BIBLE WAS WRITTEN IN GREEK AND HEBREW. ACTUALLY THEY WERE TRANSLATED SO EVERYONE CSN UNDERSTAND WHAT IT SAYS.

BRAINLIEST PLEASE

❤❤❤❤❤❤❤❤

6 0
3 years ago
Interview Questions for a game developer help needed
Katyanochek1 [597]

Answer:

just be truthful

Explanation:

8 0
4 years ago
Other questions:
  • based on the transcript, what did broadcasting the story through the medium of radio allow welles to do?
    8·1 answer
  • What number is needed to complete the pattern 66, 73, 13, 21, 52,_, 10, 20?
    12·1 answer
  • Password cracking is a technique used to extract user’s password of application/files without the knowledge of the legitimate us
    11·1 answer
  • Presentation software allows business professionals to _____.
    14·2 answers
  • Witch word in the sentence is a noun? the food he is cooking smells delicious.
    7·1 answer
  • What's the purpose of maintaining a network of digital forensics specialists?
    14·1 answer
  • 10^4+10-2=<br>10^4+10-2=
    12·2 answers
  • Ben is writing a paper for his college history class, and he wants to include some information he found on a Web site. What are
    5·1 answer
  • What is the range for copper tape
    15·1 answer
  • You want to purchase a computer, and the salesperson refers to separate pricing for a system unit and for the software applicati
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!