Question

Implement a function ion2e() that takes a string as a parameter. If the string ends with...

Implement a function ion2e() that takes a string as a parameter. If the string ends with 'ion' it returns the initial part of the string (before the 'ion') followed by an 'e' with no extra spaces. If the string does not end with 'ion', including the circumstance in which the string contains 'ion' as a substring, it returns the original string. The following shows several examples of how the function would be used:

ion2e('congratulation')
congratulate
ion2e('marathon')
marathon
ion2e('hyperrational')
hyperrational
ion2e('irradiation')
irradiate

0 0
Add a comment Improve this question Transcribed image text
Request Professional Answer

Request Answer!

We need at least 10 more requests to produce the answer.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the answer will be notified once they are available.
Know the answer?
Add Answer to:
Implement a function ion2e() that takes a string as a parameter. If the string ends with...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Similar Homework Help Questions
  • (7) Implement the shorten_space() function. shorten_space() has a string parameter and updates the string by replacing...

    (7) Implement the shorten_space() function. shorten_space() has a string parameter and updates the string by replacing all sequences of 2 or more spaces with a single space. shorten_space() returns the string. Call shorten_space() in the print_menu() function, and then output the edited string. Hint: Look up and use Python function .isspace(). Ex: Edited text: we'll continue our quest in space. there will be more shuttle flights and more shuttle crews and, yes, more volunteers, more civilians, more teachers in space....

  • def zigzag(text): Implement a function that takes a string and returns a new string that is...

    def zigzag(text): Implement a function that takes a string and returns a new string that is a zig-zag rearrangement of it like the one in the examples below. • Parameters: text is a string (no validation needed) • Examples: zigzag('12345678') → '18273645' zigzag('123456789') → '192837465' zigzag('abcdefgh') → 'ahbgcfde' zigzag('GeorgeMason') → 'GneoosragMe' in python

  • 7.10 Strings Implement the get_num_of_non_WS_characters() function. get_num_of_non_WS_characters() has a string parameter and returns the number of...

    7.10 Strings Implement the get_num_of_non_WS_characters() function. get_num_of_non_WS_characters() has a string parameter and returns the number of characters in the string, excluding all whitespace. Implement the get_num_of_words() function. get_num_of_words() has a string parameter and returns the number of words in the string.

  • Define a Python function named getResponse() that takes a string as its only argument and returns...

    Define a Python function named getResponse() that takes a string as its only argument and returns a new string. If the argument ends with a question mark and has an even number of characters, the function should return the string "Yes". If the argument ends with a question mark and contains an odd number of characters, the function should return the string "No". If the argument ends with an exclamation point, the function should return the string "Wow". Otherwise, the...

  • python Implement function get_contact(contacts, name) that returns a string. The contacts and the name parameter are...

    python Implement function get_contact(contacts, name) that returns a string. The contacts and the name parameter are both type string. This function checks for the name string in the contacts string and returns that person's contact information. If the person is not found, the function returns, "name not in contact". Assume input is always valid. Assume the same name is not repeated in contacts. [You may use split(), range(), len() ONLY and no other built-in function or method] Examples: contacts =...

  • Write a function named "csv_to_list" that takes a string as a parameter representing the name of...

    Write a function named "csv_to_list" that takes a string as a parameter representing the name of a CSV file with 5 columns in the format "<int>,<int>,<int>,<int>,<int>" and returns a new list containing all the values in the third column as integers in the same order they appear in the input file //JAVASCRIPT //

  • Define the is_a_valid_date() function which is passed a string as a parameter. The function returns a...

    Define the is_a_valid_date() function which is passed a string as a parameter. The function returns a boolean indicating whether the parameter string is a valid date or not. The first two lines of the function are: month_names = ["January", "February", "March","April", "May", "June", "July", "August", "September", days_in_month = (31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31) where month_names is a list of valid month names, and days_in_month is a list which contains the maximum day number...

  • Define the is_a_valid_date() function which is passed a string as a parameter. The function returns a...

    Define the is_a_valid_date() function which is passed a string as a parameter. The function returns a boolean indicating whether the parameter string is a valid date or not. The first two lines of the function are: month_names = ["January", "February", "March", "April", "May", "June", "July", "August", "September", days_in_month = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] where month_names is a list of valid month names, and days_in_month is a list which contains the maximum day...

  • project-8a Write a function named count_letters that takes as a parameter a string and returns a...

    project-8a Write a function named count_letters that takes as a parameter a string and returns a dictionary that tabulates how many of each letter is in that string. The string can contain characters other than letters, but only the letters should be counted. The string could even be the empty string. Lower-case and upper-case versions of a letter should be part of the same count. The keys of the dictionary should be the upper-case letters. If a letter does not...

  • (Python)Implement the function deep_list, which takes in a list, and returns a new list which contains...

    (Python)Implement the function deep_list, which takes in a list, and returns a new list which contains only elements of the original list that are also lists. Use a list comprehension. def deep_list(seq): "" "Returns a new list containing elements of the original list that are lists. >>> seq = [49, 8, 2, 1, 102] >>> deep_list(seq) [] >>> seq = [[500], [30, 25, 24], 8, [0]] >>> deep_list(seq) [[500], [30, 25, 24], [0]] >>> seq = ["hello", [12, [25], 24],...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT