> did you test the script? here's a simulator: < snip>
Fredrik, thank you very much indeed for taking the trouble to show me the way. I am sorry that I made the comment I did, that will teach me to read more carefully. It is said that there is no fool like an old fool and, as I am approaching 78 years old, I think I qualify. It is also said that you are never too old to learn so I am trying. Now, I put the script you gave into an editor and ran it , (I use Ubuntu Linux by the way). It certainly showed how the computer arrived at the number guessed but guessed the number itself and gave me no chance to say whether high or low. I noticed also that the numbers were all greater than 50 and the loop ran until the number guessed was 100, then it stopped. Perhaps you can point out to me how I should go about debugging. Incidentally, I am only just starting to learn about functions and have not come across the module 're'. Also why is it (lo+hi)//2 and not (lo+hi)/2. Thanks again for your help. Norman > # end > >> Comments please. > > if this had been a java "let's pretend you're the java runtime" > certification question, you would have failed. > > </F> -- http://mail.python.org/mailman/listinfo/python-list