1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| tmp=input('Enter the year:') while not tmp.isdigit() : tmp=input('Enter a \'number\' again:') year=int(tmp) a=year/4 b=year/100 c=year/400 d=int(c) e=int(a) f=int(b) if d==c: print(year,'YES') else: if a==e and f!=b: print(year,'YES') else: print(year,'NO')
|