Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- valores = [-3, 'Python', 7, -13, '17a', '3', 11]
- def filtrar_numericos(valor):
- try:
- int(valor)
- return True
- except ValueError:
- return False;
- valores_filtrados = list(filter(filtrar_numericos, valores))
- print(valores_filtrados)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement