@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...


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

@Sphinx Not sure if you're looking for commentary on your code. You posted it, so I figured that you were okay with the idea.


Thanks, I do not mind that you are sharing with your ideal, at least I know who to ask for help in the future when I have questions about python. 😊

@Sphinx make sure to slap @Lwasserman before asking, to get proper attention

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.