On 2013-10-29, Alister <alister.w...@ntlworld.com> wrote: > set the number to be guessed > get the user input > step through each digit in the input > compare to the co-responding digit in the number to be guessed > generate the required output > > actually let me just expand on my earlier teaser code > > does this switch on any light-bulbs for you > > data='7865' > guess=input('guess') > for key,digit in enumerate(data): > print digit,guess[key]
I just want to add that this programming exercise, while pretty common, stinks. A new programmer shouldn't be embroiled in the morass of interactive programming. -- Neil Cerutti -- https://mail.python.org/mailman/listinfo/python-list