Question: Write a function extract-chars () that takes one argument, data, which is a string that is supposed to contain only uppercase letters, lowercase letters,

Write a function extract-chars ) that takes one argument, data, which is a string that is supposed to contain only uppercaseFunction ArgumentReturn Value ,<2 1@ 3 { , % { ^YS18, | [,Y, , ,ǐ,, ,2138, , ,<@s^%,] 27697091 [,, 27697091, ] Note: The  

Write a function extract-chars () that takes one argument, data, which is a string that is supposed to contain only uppercase letters, lowercase letters, digits and the punctuation marks given in the following string: ! @ # $ %^&* ( ) ? . The function reads the characters of the string from left-to-right, separating the uppercase letters, lowercase letters, digits and punctuation marks into four different result strings. The characters from the input string are appended to the four result strings in the same order they are read from the input. For example, if A appears to the left of B in data, then A will appear to the left of B in the result string of uppercase letters. In the end, the function puts these four strings into a single list, and returns the list. Note: The order of the strings in the final list always matches this order: [string of uppercase letters, string of lowercase letters, string of digits, string of punctuation marks] If the function that encounters a character that s neither an uppercase letter, nor a lowercase letter, nor a digit, nor a punctuation mark from the list given above, your function ignores that character and proceeds through the remainder of the string. Function Argument

Step by Step Solution

3.42 Rating (152 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Required solution is given below def extract... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!