Answered You can hire a professional tutor to get the answer.

QUESTION

Python program that takes a string from user and removes all characters in that string except alphabets. Sample Input : "sfh79sgg!@6$pq" Sample...

Python program that takes a string from user and removes all characters in that string except alphabets.

: "sfh79sgg!@6$pq"

: "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

Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question