I know that the question is quite ambiguous, so I'll expand on my problem. I have written a short thingy over here as practice since I just started learning python and am sort of a newbie.
In my code, I ask the user how many apples they have and if they would like to eat it. If they keep saying "Y" until the amount of apples is 0 (#mention 1
in the screenshot), I want my code to redirect to the #redirect 1
part, instead of writing the entire code from #redirect 1
again. I know that I could just rewrite it, however, I can't for the next part. If there are no apples, I ask the user if they want to buy them and the amount.
Then I would like to redirect the code back to #redirect 2
so that the code plays out again. I have read previous questions and understand that a 'goto' doesn't exist as it is unstructured, however, I have no idea how else I would write my code. Sorry for the dumb question, but as I said I am new to this.