elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: (TUTORIAL) Aprende a emular Sentinel Dongle By Yapis


  Mostrar Mensajes
Páginas: [1]
1  Programación / Scripting / Re: [Python] - Los años no perdonan. en: 2 Diciembre 2010, 17:09 pm
Saludos a todos,
aprovecho para presentarme, jejeje.
Soy pirob y desde hace un tiempo estoy prendiendo python por mi cuenta. Encontré este foro en el que hay mucha información al respecto y nada, aquí me tenéis  :P

Bueno, respecto al código he hecho esto:
Código
  1. # By pirob - 2/12/2010
  2.  
  3. def bisiesto():
  4.  
  5.  year = int(raw_input("Introducelo: "))
  6.  
  7.  if year % 4 == 0:
  8.    if year % 100 != 0:
  9.      print "%d es bisiesto." % year
  10.  
  11.    else:
  12.      if year % 400 == 0:
  13. print "%d es bisiesto" % year
  14.      else:
  15. print "%d no es bisiesto." % year
  16.  
  17.  else:
  18.    print "%d no es bisiesto." %year
  19.  
  20.  return year
  21.  
  22. bisiesto()
  23.  

A mí me funciona bien, pero es cuestión de que lo probéis  :rolleyes:
 
Páginas: [1]
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines