Skip to content

Instantly share code, notes, and snippets.

@elpargo
Created February 25, 2014 23:48
Show Gist options
  • Save elpargo/9220468 to your computer and use it in GitHub Desktop.
Save elpargo/9220468 to your computer and use it in GitHub Desktop.
simple print example
print("Es par o impar")
print
numero = int(raw_input("introducir un numero")) #utiliza raw_input, ya que input puede traer codigo ejecutable http://stackoverflow.com/questions/3800846/differences-between-input-and-raw-input
if numero%2: #en python el if evalua directo so == 0 es inneesario
print ("El numero ingresado es par") #usa los parentesis simple, ya que en py3 no son opcionales
else:
print ("El numero ingresado es impar")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment