Oct-30-2018, 01:52 PM
The reason your loop goes on forever is that you never change either string or i in the loop. So the condition in the while statement never changes.
This says to me that you want to get a new input each time through the loop. But you don't have an input inside the loop. You need one inside the loop, so you have a changing value for your while condition. However, it seems from the question in the input that the while condition should be looking for -1. I think the pseudocode it talking about this kind of structure:
pseudocode Wrote:While another value has been read successfully
This says to me that you want to get a new input each time through the loop. But you don't have an input inside the loop. You need one inside the loop, so you have a changing value for your while condition. However, it seems from the question in the input that the while condition should be looking for -1. I think the pseudocode it talking about this kind of structure:
answer = input('Keep going? ') while answer != 'no': print('okay') answer = input(Keep going? ')
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures