Write a function which expects one argument and the name

Assignment Help Python Programming
Reference no: EM132356875

Question

The following rhyme helps us remember how many days there are in any given month:

Thirty days has September,

April, June, and November,

All the rest have thirty-one,

Except February which has twenty-eight.

More accurate versions of the rhyme deal with the problem posed by the leap year, but let's ignore that for now. Write a function called days which expects one argument, the name of a month as a string, and returns the number of days in that month as given in the rhyme.

Assume the argument passed to the function is a valid argument; do not validate the argument. Here are some examples of how your function should work:

>>> days("January")

31

>>> days("February")

28

>>> days("March")

31

>>> days("April")

30

>>>

Reference no: EM132356875

Questions Cloud

What is the difference between an adaptor and an innovator : What is the difference between an adaptor and an innovator in a business environment? Provide APA reference.
What are divergent thinking and convergent thinking : What are divergent thinking and convergent thinking? What is the difference between them? Provide APA reference.
Develop a corporate innovation strategy : Identify and describe three key elements on which managers should concentrate to develop a corporate innovation strategy.
Difference between closed innovation and open innovation : What is the difference between closed innovation and open innovation? Provide APA reference.
Write a function which expects one argument and the name : Write a function called days which expects one argument, the name of a month as a string, and returns the number of days in that month as given in the rhyme.
What you are doing as a volunteer : Please introduce yourself and share with the group what you are doing as a volunteer.
What is the equation of the shark path : Suppose a shark is at the point (5, -4) when it first detects the presence of blood in the water. What is the equation of the shark path
Realm of a self-fulfilling prophecy : What does this mean and how does the self-fulfilling prophecy affect individuals' behaviors in an organization?
Compute the amount of a tip to leave at a restaurant : This purpose of this program is to compute the amount of a tip to leave at a restaurant after a meal. The program asks the user for the amount.

Reviews

Write a Review

Python Programming Questions & Answers

  Application that will allow user to maintain collections

Build a menu-driven application that will allow a user to maintain their collections. For example, I might have a coin collection, or a record collection, or a collection of all my valuable items.

  Write a python script that will accept an input file

You need a python script that will accept an input file and count the number of words in a paragraph in the file.

  A python program that takes a value from a user and store

You need help writing a Python program that takes a value from a user and stores it in the registry.

  Display the contents of the list using a for loop

A program that populates a list of 8 car manufacturers. You can have the user populate the list or have it predefined. displays the contents of the list.

  Write a program that asks a user for a positive nonzero

Write a program that asks a user for a positive nonzero integer value. The program should use a "while loop" to get the sum from 1 up to the number entered.

  Display the percent-ages of the overall grade

Write a program that uses a bar chart to display the percent-ages of the overall grade represented by the project, quizzes the midterm exam and the final exam

  Create an html web document that displays the results

Search for and download a photograph of a jackrabbit. Create an HTML Web document that displays the results and plays the blended WAV document that you created in Topic 5. Add a headline "Mythological Jackalope Discovered!"

  Calculate the final charge of a product at a retail store

Design a python program to calculate the final charge of a product at a retail store. You must also create flowcharts for each function and for the program.

  Create a python program that allows user enter class name

Create a Python program that allows user enter class name, faculty name, name of each student, and letter grade each student earned.

  How many times each letter of the alphabet was used

Allow the user to type in a sentence to allow the program to perform analytics. Find out how many times each letter of the alphabet was used in useras sentence.

  How does the a developed program work

How does the a developed program (By Python) work which looks for the words "subsidies" and "grants" and download from all Thomson Reuters Reports.

  Recogntition of handwritten mathematical expressions

Recogntition of Handwritten Mathematical Expressions - You have the source code but some part of the code has some errors. So you need to correct these errors

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd