0
0

More than 3 years have passed since last update.

奇数判定

Posted at

奇数判定のシンプルな書き方を知らなかったので。

def in_odd(value):
    if value % 2 == 1:
        return True
    return False
list = [ 0,1,2,3,4,5,6,7,8,9 ]
for item in filter(in_odd,list):
    print(item)

今知った。

独り言ありがとう。

0
0
4

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0