Get the answers you need at Westonci.ca, where our expert community is dedicated to providing you with accurate information. Discover the answers you need from a community of experts ready to help you with their knowledge and experience in various fields. Join our Q&A platform to connect with experts dedicated to providing accurate answers to your questions in various fields.

Write a program that removes all non-alpha characters from the given input. Ex: If the input is: -Hello, 1 world$! the output is: Helloworld

Also, this needs to be answered by 11:59 tonight.


Sagot :

Answer:

Explanation:

The following code is written in Python. It is a function that takes in a string as a parameter, loops through the string and checks if each character is an alpha char. If it is, then it adds it to an output variable and when it is done looping it prints the output variable. A test case has been provided and the output can be seen in the attached image below.

def checkLetters(str):

   output = ''

   for char in str:

       if char.isalpha() == True:

           output += char

   return output

View image sandlee09