Ask coding questions

← Back to all posts
Debug code
MisterMr

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

Answered by OldWizard209 [earned 5 cycles]
View Answer
Voters
MisterMr
Comments
hotnewtop
OldWizard209

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

MisterMr

@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

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

MisterMr

@OldWizard209 That sucks

JWZ6

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

MisterMr

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

MisterMr

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

ch1ck3n

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

MisterMr

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

OldWizard209

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

MisterMr

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