We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
defdayOfProgrammer(year):day=13# in 1918, February 14th was the 32nd dayifyear==1918:day+=14-1# Gregorian. either Divisible by 400, Divisible by 4 and not divisible by 100elifyear>=1919and(year%400==0or(year%4==0andnotyear%100==0)):day-=1# Julian (1700 to 1917). leap years are divisible by 4elifyear<=1917andyear%4==0:day-=1returnf'{day:02}.09.{year:04}'
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Day of the Programmer
You are viewing a single comment's thread. Return to all comments →
Python 3