0
這個y & 3
是做什麼的,這個if..if y & 3..else
語句是如何工作的?請有人能解釋嗎?從https://www.hackerrank.com/challenges/day-of-the-programmer/leaderboard&運算符在Python中用於程序
y = int(input())
if y < 1918:
ftext = "13.09.{}" if y & 3 else "12.09.{}"
elif y > 1918:
ftext = "13.09.{}" if (y & 3) or (y % 400 and not y % 100) else "12.09.{}"
else:
ftext = "26.09.{}"
print(y & 3)
print(ftext.format(y))
這是否意味着它檢查它是否可以被4整除? – user123155