python
public python v1 · immutablefrom datetime import date, datetimeclass Ej: def __init__(self): now = datetime.now() self.fecha = date(now.year, now.month, now.day) print "Para su cumple:" dia = input("Ingrese el dia\n") mes = input("Ingrese el mes\n") self.fecha_cumple = date(now.year, mes, dia) def diasHastaMiCumple(self): dif = (self.fecha_cumple -self.fecha).days if (dif<0): dif += 365 return difinst = Ej()print ("Faltan %s dias para tu cumpleaños" % inst.diasHastaMiCumple() )