+ 5
How can i do a code in python3 that deletes only letters(with def)
exemple input: avrvt25gsv57 output: 2557
2 Respuestas
+ 7
inp='avrvt25gsv57'
print(*[i for i in inp if i.isdigit()],sep='')
#if you want to do it with def.
def removeLetters(s):
return ''.join([i for i in s if i.isdigit()])
print(removeLetters(inp))