Define function which passed list of strings as parameter

Assignment Help Computer Engineering
Reference no: EM131843002

Get a lowercase string of the last three letters of each word in the parameter list

Define the get_last_three_letters() function which is passed a list of strings as a parameter. The function returns the string made up of the concatenation of the last three letters of each word in the parameter list which contains three or more letters. The string returned by the function should be in lowercase characters. If the parameter list is an empty list, the function should return an empty string.

Returns the longest word (which has six or more characters) from the parameter list

Define the get_longest_name() function which is passed a list of strings as a parameter. The function returns the word in the list which has the most characters (i.e., the longest word) BUT only words with six or more characters are considered. If two or more words in the list have the same number of characters as the longest word, the function should return the first word from the start of the list which has the most characters. If the parameter list is empty or if there are no words in the list with six or more characters, the function should return the empty string.

Returns a new list containing all the numbers from the parameter list which do not contain the digit 9

Define the get_list_nums_without_9() function which is passed a list of integers as a parameter. The function returns a new list containing all the numbers (integers) from the parameter list which do not contain the digit 9. If the parameter list is empty or if all of the numbers in the parameter list contain the digit 9, the function should return an empty list.

Returns a list of numbers with all the odd numbers at the front of the list and all the even numbers at the back

Define the get_evens_at_back() function which is passed a list of integers as a parameter. The function returns a new list with all the odd numbers from the parameter list (in sorted order) at the front and all the even numbers from the parameter list (in sorted order) at the back of the list. If the parameter list is empty, the function should return an empty list.

Remove from the parameter list of words all words which are in the parameter sentence and in the list of words

Define the alter_the_list() function which is passed a string of text and a list of words as parameters. The function removes any word from the parameter list of words which is a separate word in the string of text. The string of text should be converted to lower case before you do any checking as the elements of the parameter list of words are all in lower case. Note that there is no punctuation in the parameter string of text and each word in the parameter list of words is unique, i.e., it occurs only once.

Returns True if the parameter string is a legitimate date, the function returns False otherwise

Define the is_legitimate_date() function which is passed a string as a parameter. The function returns a boolean indicating whether the string denotes a legitimate date. The first three lines of your function should be defined as follows:

def is_legitimate_date(date_str):

month_names = ("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December")

days_in_month = (31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31)

where month_names is a list of month names and days_in_month is a list which contains the correct number of days in each month (note that February is set to 28 days), e.g., the third element of the month_names list is the month of March and the corresponding third element of the days_in_month list indicates that there are 31 days in March.

Score a hand of eight random dice throws -

In a dice rolling game a hand is made up of eight random dice throws and is valued in the following way:

In this game a run is a sequence of dice values starting from 1, e.g., 123, 12345, 1.

Each dice which is part of a run of dice starting from a 1 is valued at 3 points.

If there is no 1 in a hand of eight dice then the score for the whole hand is 0.

A hand of dice can contain more than one run.

Complete the get_hand_score() function which is passed a list of eight dice throws and returns the value of the hand according to the rules described above.

Only require the use of the simplest function in list. Joint not included.

Attachment:- Assignment Files.rar

Reference no: EM131843002

Questions Cloud

Are descartes arguments convincing to you : Descartes has several ideas on why we make mistakes and how we go wrong. Are Descartes' arguments convincing to you? Why or why not?
Evaluate descartes two proofs of god existence : Analyze and evaluate Descartes' two proofs of God's existence. How are they different? Is one more convincing than the other?
Create a one to two paragraph email with seven sentences : Create a one to two paragraph email with five to seven sentences that follows your supervisor's instructions.
Is mill moral theory consistent with the golden rule : Is Mill's moral theory consistent with the Golden Rule? Is Kant's moral theory consistent with the Golden Rule? Is Singer's theory of justice consistent
Define function which passed list of strings as parameter : Define the get_last_three_letters() function which is passed list of strings as parameter. The string returned by function should be in lowercase characters
What is the known population proportion : What is the known population proportion of getting the high tip amount of 18% or more for the waiters at this restaurant?
American philosopher and psychologist : Charles Sanders Peirce was the American philosopher and psychologist who wrote "The Will to Believe", in which he argued that the choice
What negative elements do you see in whole foods approach : Do you agree that Whirlpool can realize a competitive advantage through its diverse employees?How else can technology be used to enhance Whirlpool's culture?
Difference between categorical and hypothetical imperatives : Describe the difference between categorical and hypothetical imperatives and give an example of each (you can choose any example you want for the hypothetical i

Reviews

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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