Question: Using Python Part I: Medieval Manuscript Signatures (4 points) Scribes in Medieval Europe who laboriously hand-copied manuscripts for their patrons were generally not permitted to

Using PythonUsing Python Part I: Medieval Manuscript Signatures (4 points) Scribes in Medieval

Part I: Medieval Manuscript Signatures (4 points) Scribes in Medieval Europe who laboriously hand-copied manuscripts for their patrons were generally not permitted to explicitly take credit for their work, but many of them found a subtle way to do so anyway: they would often include a slightly-obscured version of their names at the end of the documents they had produced. Instead of using a complicated fornm of encryption, these scribes simply added their first names, with each vowel replaced by the first consonant that came after it in the alphabet. For example, "Aelfred" would be written as "Bflfrfd"('a, is replaced by 'b. e' byf", and so forth). The letter 'i' should be replaced by 'k' (remember that most of these scribes were writing in Latin, which does not have a distinct letter 'j).Complete the signature () function, which takes a single string argument representing a name. Your function may assume that the name is all lowercase, but it MAY NOT assume that it only contains letters. In other words, any letters in the input will be lowercase, but the input may also contain spaces, dashes, digits, and other non-letter characters. If the input string only contains letters, the function should return the enciphered equivalent of this name, using the process described above. If the input string contains at least one non-letter character, your function should return the string "ERROR" instead. . Your code only needs to replace the five "normal" vowels (a, e, i, o, and u) don't change or replace any occurrences You may assume that the input will never contain the letter (this technically doesn't affect anything, but we will assume that the input always conforms to this omission from the Latin alphabet) Your solution does not need to worry about "collapsing" adjacent vowels into a single consonant. For example, it should translate a name like "aethelred" into "bfthflrfd" without treating the initial "ae" pair as a single vowel (as would have been done in Old English or Middle English) For example, given the user input "othuil", your program should display the translated name "pthvkl" Hint: You can test for a valid lowercase letter with the in operator and a string that contains all 26 lowercase English letters (like the Python constant string.ascii_lowercase). Examples: Function Call signature ("uther") signature ("essaul") fssbvl signature ("maerl4n" ERROR Return Value vthfr Part II: Odd Runs of Zeroes (4 points) Complete the oddRuns ) function, which takes a single string argument that contains only Os and 1s. The function counts and returns the total number of odd-length runs (sequences) of 0s in the string. A run boundary is marked either by a 1 or by the beginning or end of the string. For example, the string "101111111001000" has 2 odd-length runs of Os: "0" and "000" (there are three runs of 0s in al, but the middle run only contains 2 0s, so it doesn't count). Hint: In addition to your run-counting variable, use two more variables to track if you are currently in the middle of a run of 0s, and how many 0s you have seen in the current run. If you are NOT currently in a run and you encounter a 0, note that you are in a run, and set your count of Os to 1. When a run of 0s ends (due to encountering a 1 OR the end of the string), check to see if its length is odd and update your count appropriately, then clear your "currently in a run of Os" variable amples: Function Call oddRuns ("0101110000) oddRuns ("001001110010000") oddRuns ("10001011011011100011")5 Return Value

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!