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)
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)
+ 2
Using regular expression you can solve it in easy way.
https://www.tutorialspoint.com/JUMP_LINK__&&__python__&&__JUMP_LINK/python_reg_expressions.htm
+ 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