Sort by

recency

|

1565 Discussions

|

  • + 0 comments

    Mi solución en Python 3:

    def dayOfProgrammer(year):
        # Write your code here
        if year in range ( 1700, 1918):
            if year %4 == 0:
                return "12.09." +str(year)
            else:
                return "13.09." +str(year)
        if year in range ( 1919, 2701):
            if (year %400 == 0) or (year%4 == 0)and (year%100 != 0):
                return "12.09." +str(year)
            else:
                return "13.09." +str(year)
        if year == 1918:
            return "26.09." +str(year)
    
  • + 0 comments

    Python 3

    def dayOfProgrammer(year):
    
        # During Transition 13 days skipped
        if year == 1918:
            return "26.09.1918"
        
        # Julian calendar
        if year < 1918:
            leap = (year % 4 == 0)
            
        # Gregorian calendar
        elif year > 1918:
            leap = (year % 400 == 0) or ((year % 4 == 0) and (year % 100 != 0))
        if leap:
            return f"12.09.{year}"
        else:
            return f"13.09.{year}"
    
  • + 0 comments

    Python 3

    def dayOfProgrammer(year):
        day = 13
        
        # in 1918, February 14th was the 32nd day
        if year==1918:
            day+=14-1
        # Gregorian. either Divisible by 400, Divisible by 4 and not divisible by 100
        elif year>=1919 and (year%400==0 or (year%4==0 and not year%100==0)):
            day-=1
        # Julian (1700 to 1917).  leap years are divisible by 4
        elif year<=1917 and year%4==0:
            day-=1
        
        return f'{day:02}.09.{year:04}'
    
  • + 0 comments

    Day of the Programmer celebrates the contributions of programmers to technology and innovation, highlighting their critical role in shaping the digital world, including tools like Magento Service Gonzay. It's a day to recognize and appreciate the work behind the software that powers our daily lives.

  • + 1 comment

    Pretty sure this question is broken, some test cases are incorrect / contradictory