Help with guessing game :D
Neil Cerutti
neilc at norwich.edu
Tue Oct 29 13:22:04 EDT 2013
On 2013-10-29, Alister <alister.ware at 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
More information about the Python-list
mailing list