Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
除算可能なすべての数値を2倍にし、除算可能なすべての数値を3倍にし、すべての奇数を省略したリスト内包表記を作成しようとしています(1から100の範囲)。ありがとう!
[x*3 if not x%4 else x*2 for x in range(2,101,2)]
def silly_fun(x): if x%4 == 0: return 3*x else: return 2*x [silly_fun(y) for y in data if y%2 == 0]