Created
January 18, 2019 18:20
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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