Ask coding questions

← Back to all posts
Debug code
MisterMr (1)

How do I debug code on Replit. All the options I found online haven't worked.

Answered by OldWizard209 (1498) [earned 5 cycles]
View Answer
OldWizard209 (1498)

You can also create try except blocks and raise errors on exceptions.

MisterMr (1)

@OldWizard209 I tried using try except blocks to raise exceptions and I found what was wrong with the code! Now it works PERFECTLY! THANK YOU!

OldWizard209 (1498)

You can't debug on replit, you need to manually go through al the code. Replit only tells u the error

JWZ6 (644)

For line 92, hold backspace till the input is on the same line with the (. Hopefully this helps 👍

MisterMr (1)

@JWZ6 The last question still repeats so that helped but it still breaks later on in the code.

MisterMr (1)

I would also appreciate it if someone can tell me how to fix the code!

ch1ck3n (2028)

@MisterMr first i need to know the answer to the question

MisterMr (1)

@ch1ck3n lol you can google them or you can check the code.

OldWizard209 (1498)

Firstly, what is the problem in the code? @MisterMr
Secondly @ch1ck3n , you can see the answer from the code ;)

MisterMr (1)

@OldWizard209 The problem is that for some reason it repeats the last question. Then when you answer it, it causes a keyerror since the computer has removed the question and answer from the dictionary since it has already been answered.

I need to know why it keeps repeating the last question and how to fix this.