Task 12 Write a python program that takes 2 inputs from the user. The first input is a string and the second input is a letter. The program should remove all occurences of the letter from the given...


Task 12<br>Write a python program that takes 2 inputs from the user. The first input is a string and the second input is a letter. The program should remove all occurences<br>of the letter from the given string and print the output. If the letter is not found in the string and the length of string is greater than 3, then remove the first letter<br>and last letter of the given string and print it. Otherwise print the string as it is. [You can assume that all the input will be in lowercase letter]<br>Sample Input 1:<br>tanjiro kamado<br>a<br>Sample output 1:<br>tnjiro kmdo<br>Explanation: All 3 instances of the character 'a' is removed from the input String 'tanjiro kamado' to give us output 'tnjiro kmdo'.<br>========<br>========<br>

Extracted text: Task 12 Write a python program that takes 2 inputs from the user. The first input is a string and the second input is a letter. The program should remove all occurences of the letter from the given string and print the output. If the letter is not found in the string and the length of string is greater than 3, then remove the first letter and last letter of the given string and print it. Otherwise print the string as it is. [You can assume that all the input will be in lowercase letter] Sample Input 1: tanjiro kamado a Sample output 1: tnjiro kmdo Explanation: All 3 instances of the character 'a' is removed from the input String 'tanjiro kamado' to give us output 'tnjiro kmdo'. ======== ========

Jun 09, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here