Skip to content

Instantly share code, notes, and snippets.

@tknhs
Last active August 29, 2015 14:02
Show Gist options
  • Save tknhs/38eb97a5a5a8e68c259b to your computer and use it in GitHub Desktop.
Save tknhs/38eb97a5a5a8e68c259b to your computer and use it in GitHub Desktop.
うるう年チェック
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# if文禁止
print([i%j == 0 for i, j in zip([int(input())]*3, [4, 100, 400])].count(True) % 2 == 1)
# if文・for文禁止
print(sum(list(map(lambda x, y: x%y == 0, [int(input())]*3, [4, 100, 400]))) % 2 == 1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment