#๐ need help with a task (very new to coding)
23 messages ยท Page 1 of 1 (latest)
@formal hatch
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
you are using a <= to check if the sum is equal to the limit, thus even when it is 3 (1 + 2) it evaluates that 3 <= 3, it is equal so it continues
the order in which you run things is really important. You should be doing divert += 1 at the end of the loop
right now you're increasing it, and then totalling it. This means you skip the first number
Bzale is correct too about the loop condition
oh
if he first adds before incrementing wouldnt that be 1 + 1 ?
you set the 1 before the loop so it kind of checks out
per the instruction, the loop should stop when it's at least equal
but your while loop doesn't stop at equal
how do I make it stop at equal?
just remove the = sign
ok
ahh yeah, I missed that the total starts at 1 too
do I move divert back?
removing the "=" sign should be enough
thanks
np
This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.