profit / gain [terminology] Terminology¶ Usage¶ Keep domain-specific terms when they explain the quantity better than generic terms. profit is the accumulated financial result. gain is a positive or potentially useful increase between prices. profit = 0 for i in range(1, n): gain = prices[i] - prices[i - 1] if gain > 0: profit += gain See 122. Best Time to Buy and Sell Stock II.