Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created January 18, 2019 18:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/4f030a36d1eb3c17d73e4d666ad266b8 to your computer and use it in GitHub Desktop.
Save parzibyte/4f030a36d1eb3c17d73e4d666ad266b8 to your computer and use it in GitHub Desktop.
Ver si es flotante en Python created by parzibyte - https://repl.it/@parzibyte/Ver-si-es-flotante-en-Python
def es_flotante(variable):
try:
float(variable)
return True
except:
return False
datos = ["123", "asd", "eeee", "----", "-5", "1.60"]
for dato in datos:
print("¿'{}' es un flotante? {}".format(dato, es_flotante(dato)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment