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  

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

1 Expert Approved Answer
Step: 1 Unlock

Answer To achieve the desired result of remo... 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 Programming Questions!