0

Is there another way to solve it?

https://www.sololearn.com/coach/57?ref=app ====== Idiot list ====== x = str(input()) y = list(x) answer = "" c1 = ["q","w","e","r","t","y","u","i","o","p","a","s","d","f","g","h","j","k","l","z","x","c","v","b","n","m"," ","1","2","3","4","5","6","7","8","9","0","Q","W","E","R","T","Y","U","I","O","P","A","S","D","F","G","H","J","K","L","Z","X","C","V","B","N","M"] for i in y: if i in c1: answer += i print(answer)

13th Mar 2020, 1:46 AM
Ahmed Mohamed
3 Respuestas
+ 4
ss = input() newstr = "" for i in range(0, len(ss)): if ss[i] in "@#
amp;*%": continue else: newstr += ss[i] print(newstr)
13th Mar 2020, 4:34 AM
Александр Васильев
Александр Васильев - avatar
13th Mar 2020, 2:02 AM
A͢J
A͢J - avatar
+ 1
isalnum() string method checks whether all the characters in a string are alphanumeric, that is either Latin letters or Arabic digits. So, use it instead
13th Mar 2020, 7:40 AM
Axelocity
Axelocity - avatar