Calculate money placed in boxes after N days based on given conditions | Function to find the total money placed in boxes after N days ; Stores the total money ; Iterate for N days ; Adding the Week number ; Adding previous amount + 1 ; Return the total amount ; Input ; Function call to find total money placed
def totalMoney ( N ) : NEW_LINE INDENT ans = 0 NEW_LINE for i in range ( 0 , N ) : NEW_LINE INDENT ans += i / 7 NEW_LINE ans += ( i % 7 + 1 ) NEW_LINE DEDENT return ans NEW_LINE DEDENT N = 15 NEW_LINE print ( totalMoney ( N ) ) NEW_LINE