@Sphinx My inclination would be to write that as:

n = 100
counter = 1
while counter <= n:
counter += 1

I think that "sum" is unnecessary. You could add "step" variable, if you don't want to count by ones.

@Lwasserman wha? the sum is the whole point of the exercise, always read the problem carefully, kids...

@Sphinx

Follow

@namark @Sphinx Thought the goal was to count to a hundred by ones.

Sign in to participate in the conversation
CleverLibre Social

CleverLibre Social is an inclusive social instance for open discussion, learning, and community.
All cultures welcome.
Hate speech and harassment strictly forbidden.