Welcome to Westonci.ca, the Q&A platform where your questions are met with detailed answers from experienced experts. Experience the convenience of getting reliable answers to your questions from a vast network of knowledgeable experts. Join our platform to connect with experts ready to provide precise answers to your questions in different areas.

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
Thank you for visiting our platform. We hope you found the answers you were looking for. Come back anytime you need more information. We hope you found this helpful. Feel free to come back anytime for more accurate answers and updated information. We're dedicated to helping you find the answers you need at Westonci.ca. Don't hesitate to return for more.