Write a function called generate_initials() which takes a string as input, where the string represents someone's full name. The function should return a string containing the initials of that person....


Write a function called generate_initials() which takes a string as input, where the string<br>represents someone's full name. The function should return a string containing the initials of<br>that person. The initials are simply the first letter of each part of the name that is separated<br>by a space.<br>If the input string does not contain any space characters, then it is not possible to generate<br>initials. In this case, the function should raise a ValueError with the error message

Extracted text: Write a function called generate_initials() which takes a string as input, where the string represents someone's full name. The function should return a string containing the initials of that person. The initials are simply the first letter of each part of the name that is separated by a space. If the input string does not contain any space characters, then it is not possible to generate initials. In this case, the function should raise a ValueError with the error message "ERROR: Invalid name!". Note: You *must* use 'raise' in your solution. For example: Test Result print(generate_initials ('Paul Denny')) PD try: ERROR: Invalid name! print(generate_initials(' Paul')) except ValueError as e: print(e) Answer: (penalty regime: 0, 0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50 %)

Jun 09, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here