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]
3 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]3 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
Q2
rosijanka [135]

Answer:

Computer is a electronic device which give us accurate result in a short preodical of time

6 0
2 years ago
Read 2 more answers
While inspecting an element in the DOM on my website using the Chrome Devtools I accidentally deleted the DIV that had all my au
Kobotan [32]

Answer:

Refresh the page, it will reset all the underlying code.

Explanation:

Inspecting an element is essential for web developers in building websites faster and better. The Chrome DevTools is a powerful tool that is integrated into the Chrome browser to assist developers in on-the-go website troubleshooting.

Editing codes in the Chrome DevTools console does not affect the source code of the website hosted on a server, it just provides instant editing functions for troubleshooting or website enhancement.

Therefore, refreshing the page, re-loads the website again from its database which will show the unedited website. In our scenario, after refreshing the page, all the deleted DIV that contains all the authentication will reappear again.

4 0
3 years ago
To communicate with coworkers in the office
Elanso [62]

For effective communication to occur, everyone must trust and respect each other. ... Clear and concise communication will allow your colleagues to understand and then trust you. As a result, there will be more cooperation and less conflict in the workplace.

8 0
3 years ago
Select the correct answer.
Softa [21]

Answer:

MY ANSWER IS B.

Explanation:

B.A+(B.C)

3 0
3 years ago
Dzięńdobry kto ogarnia komędy w minicraft bardzo dobrze i by mi pomógł w stworzeniu serwera [dostanie w zamian range właścieciel
mojhsa [17]

Playing Minecraft on a public server can take the game to a whole. This will help your kid learn social skills, such as cooperating, while there are some family-friendly servers for the Pocket Edition most server admins can “roll back” your building to the state it was in.

Explanation:

  • For Minecraft, you'll need to forward TCP port 25565 . You'll also need to enter your server's local IP address as the Output IP or Server IP for the forwarded port. This tells the router which device to point at. To find your server's local IP, open a command prompt and enter ipconfig.
  • They are safe for the most part, however they do expose you to the following risks, which can generally be negated by simply joining reputable servers. Some servers may ask users to set up an AuthMe password. If you decide to enter a password here, never ever enter the password of your Minecraft account.
  • You can divide public Minecraft servers into two types:
  1. Whitelisted servers are protected by a whitelist — that is, a list of usernames that are allowed to join the server. To join a whitelisted server, you need to apply to have your Minecraft username added to the whitelist. Typically, this involves filling out a form and waiting a few hours or days.
  2. Non-whitelisted servers do not have a whitelist, which means anyone can join the server simply by entering the server’s address in their Minecraft client, as shown above.
  • Applying for a whitelisted server can be a bit of a drag especially when you have an impatient eight-year-old tugging at your sleeve but it does provide an extra degree of reassurance that all the players on the server are known to the server administrators.
8 0
3 years ago
Other questions:
  • The set of specific, sequential steps that describe exactly what a computer program must do to complete the work is called a(n)
    10·2 answers
  • In a @return tag statement the description:
    13·2 answers
  • The computer addicts are conscious about their addiction. True or false
    9·1 answer
  • _______ tools enable people to connect and exchange ideas.
    7·2 answers
  • A noisy signal has been uploaded to D2L in the files fft_signal.mat and fft_signal.txt.Write a program to estimate the power spe
    10·1 answer
  • The costs incurred when a firm buys on the marketplace what it cannot make itself are referred to as
    6·1 answer
  • An ALGORITHM IS?<br> PLEASE HELP
    14·1 answer
  • Importance of computer education​
    9·1 answer
  • Simple interest will always pay more interest than compound interest.
    14·1 answer
  • Explain the working principle of computer with suitable diagram​
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!