Skip to content
Advertisement

Trying to filter out A-Z and special characters in python

This is what I’ve tried so far:

JavaScript

It doesn’t work, can you explain why?

Advertisement

Answer

Should work.

This code will check with is_alpha if the i character is an alphabetic letter (A-Z, case unsensitive) and if it returns false, will add it to the new_string variable. Later, it will check if the string contains the characters to remove.

JavaScript

Check information for is_alpha.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement