Question: 1. Write a Python program that takes a string from user and removes all characters in that string except alphabets. Sample Input: sfh79sgg!@6$pq Sample
1. Write a Python program that takes a string from user and removes all characters in that string except alphabets. Sample Input: "sfh79sgg!@6$pq" Sample Output: "sfhsggpq" *** The ASCII value of lowercase alphabets are from 97 to 122. And, the ASCII value of uppercase alphabets are from 65 to 90. If the ASCII value of the character entered by the user lies in the range from 97 to 122 or from 65 to 90, that number is an alphabet. *** use ord() function to get the ascii value of a character. Like, ord('b') = 98
Step by Step Solution
There are 3 Steps involved in it
Answer To achieve the desired result of remo... View full answer
Get step-by-step solutions from verified subject matter experts
