Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created March 23, 2019 06:02
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/702e9311369dce9542b236a390a517e9 to your computer and use it in GitHub Desktop.
Save parzibyte/702e9311369dce9542b236a390a517e9 to your computer and use it in GitHub Desktop.
"""
Saber si es un número neutro, positivo o negativo en Python
@author parzibyte
"""
numero_como_cadena = input("Escribe un número: ")
numero = float(numero_como_cadena)
if numero == 0:
print("Neutro")
elif numero < 0:
print("Negativo")
else:
print("Positivo")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment