+ 1

remove all digits and symbols in PYTHON

i need to remove all digits and symbols in a code in python

31st Mar 2020, 6:11 PM
Sarah Zavahir
Sarah Zavahir - avatar
8 ответов
+ 2
import re enc = str(input()) secret = re.findall(r"[a-zA-Z\s]", enc) secret = secret[::-1] print(secret)
31st Mar 2020, 6:28 PM
Sarah Zavahir
Sarah Zavahir - avatar
+ 1
import re sw=input() w=re.sub('[^a-zA-Z- ]+','',sw) print(w[len(w)::-1]) I think the same way...no?? Urs is correct ...
31st Mar 2020, 6:33 PM
Mahanama Gamage
Mahanama Gamage - avatar
2nd Apr 2020, 5:17 AM
ANJALI SAHU
0
Did you try to solve?
31st Mar 2020, 6:12 PM
Geek
Geek - avatar
0
Yes
31st Mar 2020, 6:13 PM
Sarah Zavahir
Sarah Zavahir - avatar
0
Show us your code
31st Mar 2020, 6:15 PM
Geek
Geek - avatar
0
Plz go with isalpha and isspace methods and apend them to array and again convert it to a string.. There can be many alternatives .......
31st Mar 2020, 6:21 PM
Mahanama Gamage
Mahanama Gamage - avatar
0
Am just new here, pls can anyone put me through for the first time? I just love to code
2nd Apr 2020, 1:54 PM
Oluwatusin Emmanuel