fork download
  1. # your code goes here
  2. """
  3. カンマ区切りで入力し、奇数のみを取り出し二乗する
  4. """
  5. import sys
  6. for line in sys.stdin:
  7. line = line.strip()
  8. ents = line.split(",")
  9. print(list(map(lambda x:x**2, filter(lambda x:x%2==1, map(int, ents)))))
Success #stdin #stdout 0.02s 28384KB
stdin
1,2,3,4,5,6,7,8,9,10
stdout
[1, 9, 25, 49, 81]