問題
[10/18/2012] Challenge #104 [Easy] (Powerplant Simulation) : dailyprogrammer
日数を取り、3, 14, 100の倍数日ごとに停止する発電所の稼働日数を返す関数を作る。
解答
def plant_online_days(day): online_day = 0 for i in range(1, day+1): if i % 3 and i % 14 and i % 100: online_day += 1 return online_day