Write a python program that will take a string as an input from the user. Assume, the string will contain only lowercase letters without any spaces. Your task is to go through every character of the...

Write a python program that will take a string as an input from the user.  Assume, the string will contain only lowercase letters without any spaces. Your task is to go through every character of the string. If the character is a vowel, replace the character with its next character. If the character is a consonant, replace the character with its previous  character.Write a python program that will take a string as an input<br>from the user.<br>Assume, the string will contain only lowercase letters<br>without any spaces.<br>Your task is to go through every character of the string.<br>If the character is a vowel, replace the character with its<br>next character.<br>If the character is a consonant, replace the character with<br>its previous<br>character.<br>[You cannot use the built-in replace() function.]<br>Sample Input 1:<br>amazon<br>Sample Output 1:<br>blbypm<br>Explanation 1:<br>Since the first character is 'a', is a vowel. So it is replaced by<br>its next<br>character 'b'.<br>But 'm' is a consonant so it is replaced by 'I' which is its<br>previous<br>character.<br>Similarly 'z' is replaced by its previous letter 'y', 'o' is<br>replaced by<br>its next letter 'p'.<br>Sample Input 2:<br>aeiouxyz<br>Sample Output 2:<br>bfjpvwxy<br>Explanation 2:<br>Here 'a''e',i',o', and 'u' are replaced by their corresponding<br>next<br>characters 'b',f'j

Extracted text: Write a python program that will take a string as an input from the user. Assume, the string will contain only lowercase letters without any spaces. Your task is to go through every character of the string. If the character is a vowel, replace the character with its next character. If the character is a consonant, replace the character with its previous character. [You cannot use the built-in replace() function.] Sample Input 1: amazon Sample Output 1: blbypm Explanation 1: Since the first character is 'a', is a vowel. So it is replaced by its next character 'b'. But 'm' is a consonant so it is replaced by 'I' which is its previous character. Similarly 'z' is replaced by its previous letter 'y', 'o' is replaced by its next letter 'p'. Sample Input 2: aeiouxyz Sample Output 2: bfjpvwxy Explanation 2: Here 'a''e',i',o', and 'u' are replaced by their corresponding next characters 'b',f'j"p', and 'v' respectively. And the letters 'x''y', and 'z' are replaced by their corresponding precedina characterc 'w''v' and 'v' respectively

Jun 05, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here