#πŸ”’ Calling a Function Causes Crashes

7 messages Β· Page 1 of 1 (latest)

half pewter
#

When I call a function after my while loops, it runs the function fine, but since it checked the while loops before it called the function (I need it to do the opposite). So I tried to just call it before the while loops, and the website crashed.

For context, I'm doing AP Comp Sci Principles with codeHS. I'm using the "Karel the Dog" API. The commands are pretty self explanatory, though I wouldn't think it would matter what the commands are doing.

In the picture is the format that crashes. I need to call the "walk" function before the while loops are checked.

final ospreyBOT
#

@half pewter

Python help channel opened

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.

tropic jasper
#

can you share your code as text?
wdym the website crashed?

half pewter
#

I just figured it out, at the end of the while loops, the loop is still true, and it never becomes false. The website I am on will freeze and stop responding if that happens

#

!close

final ospreyBOT
#
Python help channel closed with !close

This help channel has been closed. 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.