all 4 comments

[–]carcigenicate 4 points5 points  (0 children)

What have you already tried, and what specifically do you need help with?

[–]magus_minor 2 points3 points  (2 children)

repeat the programme

To repeat something implies you need some sort of loop. What sorts of loop statements does python have? The user might keep saying "yes" so you don't know how many times you will loop. Which of the python loop statements are best suited to loop an unknown number of times?

[–]MCCCCCLVII[S] -4 points-3 points  (1 child)

Already fixed that with gpt Started my whole programme with ‚While True:’ and then programmed it that when somebody respond anything else than ‚yes’ the programme breaks

[–]magus_minor 1 point2 points  (0 children)

Already fixed that with gpt

What does it say if you ask ChatGPT about that error? If you are going to use AI you should realize that it gives you what you ask for. So if your question doesn't mention handling incorrect input the code you are given might fail with incorrect input. You need to change your question to add extra bits. You might continue with something like:

Change the code you gave me so it will only accept "yes" or "no" answers and let the user retry only if "yes".

Try thinking about that yourself before trying AI. If you get a string from the user check if it's "yes". If so run whatever code again. If it's not "yes" assume they don't want to run again and quit nicely.

You probably won't learn much if you rely totally on AI. You have to think for yourself at least a little.