← Back to Community
Help Needed For Help
Profile icon
SamKunefeh

I am currently working on a project that has now gotten to over 1500 lines of code. The problem however is that in a specific feature, my compiler is defying python logic and bamboozling me. (The problem is that after executing an if statement in a function, my code just exits the function instead of executing the code after the if statement, and yes, I am 99% sure that my code is correct) As a result, I have two options: Either ignore the game-breaking problem and release my project, or ask for help on the problem. However with the second option, I can't reduce the problem to a smaller size and so I would have to release the whole project itself. So, how can I solve this?

Answered by Coder100 [earned 5 cycles]
View Answer
Voters
Profile icon
SamKunefeh
Comments
hotnewtop
Profile icon
Coder100

Looks like you might have something like this:

def whatever(): if True: return 5 print('wont run')

This won't work because return returns a value, and it would be redundant to have more code be executed beyond that point.

Profile icon
SamKunefeh

@Coder100 Thanks alot dude! I literally spent a whole week trying to fix the bug, and it was just that I was executing code after returning and maybe also because another variable had the same name as the return value :P Nevertheless, I will post my game in a few days!

Profile icon
Coder100
Profile icon
RYANTADIPARTHI

can i see your repl?

Profile icon
SamKunefeh

@RYANTADIPARTHI Thanks, but I have solved the problem now (it was a silly one). Nevertheless, will make sure to release my game in a few days!

Profile icon
Coder100

then just release the code lol

Profile icon
xxpertHacker

However with the second option, I can't reduce the problem to a smaller size and so I would have to release the whole project itself. So, how can I solve this?

Then release the whole project here, and give us the line number.

Profile icon
SamKunefeh

@xxpertHacker Thanks, but I have solved the problem now (it was a silly one). Nevertheless, will make sure to release my game in a few days!