Jun-14-2022, 05:43 PM
(Jun-14-2022, 10:36 AM)buran Wrote:(Jun-14-2022, 07:13 AM)rob101 Wrote: I'll have to think about that one.Hint: think slices
Ah... I think I see what you're driving at:
So, I'd leave 'result' as is, then slice 'listNums' from 1 to the end within the sum() function, which can then be decremented from 'result', right?
n.b: I'd post the one line of code that demonstrates the above, but I've already messed up and don't want to do that again.
Sig:
>>> import this
The UNIX philosophy: "Do one thing, and do it well."
"The danger of computers becoming like humans is not as great as the danger of humans becoming like computers." :~ Konrad Zuse
"Everything should be made as simple as possible, but not simpler." :~ Albert Einstein
>>> import this
The UNIX philosophy: "Do one thing, and do it well."
"The danger of computers becoming like humans is not as great as the danger of humans becoming like computers." :~ Konrad Zuse
"Everything should be made as simple as possible, but not simpler." :~ Albert Einstein