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
Nitella [24]
3 years ago
12

Write a function called convert_format which converts the format of a date from mm/dd/yyyy to month name dd, yyyy.

Computers and Technology
1 answer:
My name is Ann [436]3 years ago
7 0

Answer:

The code is given using Python

Explanation:

#datetime to be import

from datetime import datetime

#function convert_format to convert_format date to particular format

def convert_format():

#take date from user input

inputDate = input('Enter a date(mm/dd/yyyy): ')

#using datetime convert to format month day year

dateObject = datetime.strptime(inputDate, '%m/%d/%Y')

#print the date

print(dateObject.strftime('%B %d, %Y'))

#function call

convert_format()

You might be interested in
Which Creative Commons license type allows others to use and build upon work non-commercially, provided that they credit origina
Vera_Pavlovna [14]

Answer:

Creative Commons license type allows others to use and build upon work non-commercially, provided that they credit original author and maintain the same licensing is described below in detail.

Explanation:

Attribution-Non financially-ShareAlike

This permission lets others adapt, remix, and develop upon your work non-financially, as long as they charge you and license their new inventions under identical times. There are six separate license classes, scheduled from most to least licensed. the material in any mechanism or arrangement, so long as attribution is given to the originator.

8 0
3 years ago
Mrs. Patel uses a computer program to balance her checkbook. Which of the following best explains how the
Alexandra [31]

Answer:

c it reduces errors

Explanation:

Instead of Mrs.Patel doing it she has an online program made for checks to do it for her.

6 0
3 years ago
Recycling one glass jar saves enough energy to watch television for 3 hours
vaieri [72.5K]

Answer:

Cool

Explanation:

Thanks for the info

7 0
3 years ago
Read 2 more answers
Write a program that allows the user to enter the last names of five candidates in a local election and the number of votes rece
amm1812

Answer:

a= input("Enter the last name of first candidate: ")

aVotes= int(input("Enter Number of votes cast for "+ a + ": "))

b= input("Enter the last name of second candidate: ")

bVotes= int(input("Enter Number of votes cast for "+ b + ": "))

c= input("Enter the last name of third candidate: ")

cVotes= int(input("Enter Number of votes cast for "+ c + ": "))

d= input("Enter the last name of fourth candidate: ")

dVotes = int(input("Enter Number of votes cast for "+ d + ": "))

e= input("Enter the last name of fifth candidate: ")

eVotes = int(input("Enter Number of votes cast for "+ e + ": "))

votes= [aVotes,bVotes,cVotes,dVotes,eVotes]

aPercent= (round((aVotes/sum(votes))*100, 2))

bPercent= (round((bVotes/sum(votes))*100, 2))

cPercent= (round((cVotes/sum(votes))*100, 2))

dPercent= (round((dVotes/sum(votes))*100, 2))

ePercent= (round((eVotes/sum(votes))*100, 2))

print( a, ":", aVotes,"Votes", aPercent,"%")

print( b, ":", bVotes,"Votes", bPercent,"%")

print( c, ":", cVotes,"Votes", cPercent,"%")

print( d, ":", dVotes,"Votes", dPercent,"%")

print( e, ":", eVotes,"Votes", ePercent,"%")

winner= max(votes)

if winner==aVotes:

   print(a," is the Winner")

elif winner==bVotes:

   print(b," is the Winner")

elif winner==cVotes:

   print(c," is the Winner")

elif winner==dVotes:

   print(d," is the Winner")

elif winner==eVotes:

   print(e," is the Winner")

else:

   None

Explanation:

  • First section

<em> a= input("Enter the last name of first candidate: ") </em>

<em>aVotes= int(input("Enter Number of votes cast for "+ a + ": ")) </em>

<em>b= input("Enter the last name of second candidate: ") </em>

<em>bVotes= int(input("Enter Number of votes cast for "+ b + ": ")) </em>

<em>c= input("Enter the last name of third candidate: ") </em>

<em>cVotes= int(input("Enter Number of votes cast for "+ c + ": ")) </em>

<em>d= input("Enter the last name of fourth candidate: ") </em>

<em>dVotes = int(input("Enter Number of votes cast for "+ d + ": ")) </em>

<em>e= input("Enter the last name of fifth candidate: ") </em>

<em>eVotes = int(input("Enter Number of votes cast for "+ e + ": ")) </em>

Collects the last name and the number of  votes cast

  • Second section

<em>votes= [aVotes,bVotes,cVotes,dVotes,eVotes] </em>

<em />

places all the votes in a list.

The reason for this is to allow us use the "sum function" and "max function", to get the sum of all the votes.

  • Third section

<em>aPercent= (round((aVotes/sum(votes))*100, 2)) </em>

<em>bPercent= (round((bVotes/sum(votes))*100, 2)) </em>

<em>cPercent= (round((cVotes/sum(votes))*100, 2)) </em>

<em>dPercent= (round((dVotes/sum(votes))*100, 2)) </em>

<em>ePercent= (round((eVotes/sum(votes))*100, 2)) </em>

calculates the percentage of all the votes cast for the individual candidates

  • Fourth section

<em>print( a, ":", aVotes,"Votes", aPercent,"%") </em>

<em>print( b, ":", bVotes,"Votes", bPercent,"%") </em>

<em>print( c, ":", cVotes,"Votes", cPercent,"%") </em>

<em>print( d, ":", dVotes,"Votes", dPercent,"%") </em>

<em>print( e, ":", eVotes,"Votes", ePercent,"%") </em>

prints out the candidates name, number of votes received and the percentage

  • Fifth section

winner= max(votes)

gets the maximum votes cast

  • Sixth Section

if winner==aVotes:

   print(a," is the Winner")

elif winner==bVotes:

   print(b," is the Winner")

elif winner==cVotes:

   print(c," is the Winner")

elif winner==dVotes:

   print(d," is the Winner")

elif winner==eVotes:

   print(e," is the Winner")

else:

   None

uses if statements to compare the maximum votes with the votes gotten by all the candidates to get a winner

4 0
3 years ago
George already has a powerful computer to use for his course work. now he wants to purchase an inexpensive device with an attach
ExtremeBDS [4]
George should purchase a laptop computer, as it matches all the criteria.
3 0
4 years ago
Other questions:
  • URGENT!!! Which statement is true with regard to bitmap images?
    6·2 answers
  • What was the second phone made in the world called?
    5·1 answer
  • You are using a new release of an application software package. You think that you have discovered a bug. Outline the approach t
    14·1 answer
  • HELPPPP!!
    8·2 answers
  • What date does GTA 6 come out<br> A. 2020<br> B. 2019<br> C. 2021<br> D. 2022
    10·2 answers
  • hich of the following is a disadvantage of online surveys? They result in high response bias They lead to higher cost per comple
    14·1 answer
  • Give an example of movies or games that use teleportation
    11·1 answer
  • Which statement best compares routers and hubs?
    9·1 answer
  • What is a filter in excel (please keep your answer brief)
    11·1 answer
  • When a derived class method has the same name as a base class method, it is often said that the derived class method ________ th
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!