fork download
  1. from itertools import*
  2. f=lambda x:[i for i in takewhile(lambda y:y%2+1,x)]
  3.  
  4. for x in [[14, 42, 2324, 97090, 4080622, 171480372],[42, 14, 42, 2324],[7,14,42],[171480372, 13, 14, 42],[42, 14, 42, 43, 41, 4080622, 171480372]]:
  5. print(f(x))
Success #stdin #stdout 0.02s 9984KB
stdin
Standard input is empty
stdout
[14, 42, 2324, 97090, 4080622, 171480372]
[42, 14, 42, 2324]
[7, 14, 42]
[171480372, 13, 14, 42]
[42, 14, 42, 43, 41, 4080622, 171480372]