I can’t recall ever being taught anything like that … Mathematics was never my strong suit largely because of it being too abstract for it to come easily to me — it would have been nice had they taught us practical solutions like that.
FWIW, the other way I would have solved it would have been:
FWIW, the other way I would have solved it would have been:
Code:
% python Python 3.9.6 (default, Oct 18 2022, 12:41:40) [Clang 14.0.0 (clang-1400.0.29.202)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> total = 0 >>> for n in range(1,50): ... total += n ... >>> print(total) 1225
Comment