Leap Year @ Dcoder

Words
96
Reading
1 min
Listen
Play
4y

Problem: Steve is playing a quiz game with his brother John. As Steve just learned the concept of leap year, John wanted to test his knowledge. For that, John started to ask Steve whether a year is a leap year or not by giving him a random year. Steve is little confused and he asks your help to the quiz.

Input: The first line of input contains one integer T.
Next T lines will have years given by John.
Output: For each test case print "Yes" if it is a leap year else "No".
Constraints: 1<=T<=100.
103<=Year<=105.
Sample Input: 2
2000
2017
Sample Output:
Yes
No
Link

for i in range(int(input())):
  year = int(input())
  print('Yes' if year % 400 == 0 or year % 100 and year % 4 == 0 else 'No')
Leap Year @ Dcoder | Ecency