Define the getlastthreeletters function which is passed


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

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: Define the getlastthreeletters function which is passed
Reference No:- TGS02638505

Expected delivery within 24 Hours