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
Oksanka [162]
4 years ago
14

In this code, identify the repeated pattern and replace it with a function called month_days, that receives the name of the mont

h and the number of days in that month as parameters. Adapt the rest of the code so that the result is the same. Confirm your results by making a function call with the correct parameters for both months listed.

Computers and Technology
1 answer:
expeople1 [14]4 years ago
6 0

Answer:

Here is the function month_days:

def month_days(month, days):

 print (month +" has " + str(days) + " days.")

Now call this function by passing values to it as:

month_days ("June", 30)

month_days("July", 31)

The above function can also be written as:

def month_days(month, days):

 return (month +" has " + str(days) + " days.")

Now call this function by passing values to it and using print function to see the result on output screen:

print(month_days ("June", 30))

print(month_days("July", 31))

Explanation:

The above code has a function month_days which receives two arguments i.e. month which is the name of the month and days which is the number of days in that month. The method has a statement return (month +" has " + str(days) + " days.") which returns the name of the month stored in month variable followed by has word followed by the number of days stored in days variable which is followed by the word string days.

So if user passes "June" as month and 30 as days then the program has the following output:

June has 30 days.

The above program can also be written by using f-string to specify the format of the output in function month_days:

def month_days(month, days):

   output = f"{month} has {days} days."

   return (output)

Now call this function to see the output on the screen

print (month_days("June", 30))

print (month_days("July", 31))

The f-string is prefixed with 'f', which contains arguments month and days inside braces. These expressions i.e. month and days are replaced with their values specified in the calling statement.

Screenshot of the program and its output is attached.

You might be interested in
Alicia uses a software application to store the names, email addresses, and phone numbers of her friends in alphabetical order. 
Romashka-Z-Leto [24]

I'm not 100% sure but I think it might be Microsoft excel.... correct me if I'm wrong

7 0
3 years ago
Read 2 more answers
In bankruptcy, most of a debtor’s assets will probably be used to repay unsecured debt
Juli2301 [7.4K]
This is true. A person in debt could have everything from their home to vehicles to even boats and other possessions taken in order to make up for the money owed. 
5 0
4 years ago
The McCumber Model is a cube with three faces; each face has three items. It is intended to cause us to think about three areas
bagirrra123 [75]

Answer:

The three faces are information states, security goals, countermeasures.

Explanation:

Each face has different subjects about Informatics security, we will start with:

Information States

Storage is how we save data, for example, USB or hard drive.

Transmission is how we transfer data.

Process is how we make operations with data.

Security goals

Confidentiality is not showing data to unauthorized people.

Integrity is not modified data accidentally.

Availability is access to data timely.

Countermeasures

Politics is saving data with rules.

Human factors is training people in Informatics security.

Technology is software or hardware for Informatics security.

8 0
4 years ago
In which scenario would instant messaging be more useful than other forms of communication?
ivann1987 [24]
When you're busy doing things and/or be too sick for over the phone communication
7 0
3 years ago
You are able to add Sheets to your workbook by pressing the + button by the sheet tabs.
borishaifa [10]

Answer:

True

Explanation:

8 0
3 years ago
Other questions:
  • Which of the following operation is not performed by a mouse​
    11·1 answer
  • When command is transferred, the process should include a(n): A. Detailed Lesson Learned Report B. Intelligence Report C. Award
    11·2 answers
  • Peter has recently bought a media player and a digital camera he wants to buy a memory card and then use devices which memory do
    11·2 answers
  • LILLE VIC LUNCUL ANCI.
    5·1 answer
  • 2 The software needed to send an email is:
    7·1 answer
  • How are codecs related to audio file formats?
    9·1 answer
  • A presentation is widely used to present ______ and ______ effectively​
    12·1 answer
  • this email belongs to another account. enter a different account. does this mean my brainly account can only use one device and
    7·2 answers
  • So whenever I play among us, I always get killed. Like always. I want to know some Technics to being a crew mate and an impostor
    9·1 answer
  • To calculate perimeter of a rectangle​
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!