On Tuesday, 29 October 2013 19:55:13 UTC, ru...@yahoo.com  wrote:
> On Tuesday, October 29, 2013 1:03:00 PM UTC-6, Robert Gonda wrote:
> 
> > never mind you was right, for some reason I had version 2.7 :/ ,
> 
> > and btw I was wondering, is it also possible to make it more
> 
> > complex? such as if the computer will again show ā€œYā€ if a digit
> 
> > is correct but if a digit is incorrect it will say "H" as in
> 
> > too high or ā€œLā€ if it's too low? (while still keeping "Y").
> 
> > Do tell me if it sounds confusing :/
> 
> 
> 
> Sure it's possible.  What do you think would happen if you 
> 
> replaced the code that compares the digits and prints Y or
> 
> N with with something like this?
> 
> 
> 
>   if guess_str[i] > number_str[i]: print ("H", end='')
> 
>   if guess_str[i] < number_str[i]: print ("L", end='')
> 
>   if guess_str[i] == number_str[i]: print ("Y", end='')
> 
> 
> 
> (you are comparing 1-character long strings containing a
> 
> digit between "0" and "9" but they will compare the same 
> 
> way numbers do.)

> Is it possible to further more specify it? H only shows if the guess is at 
> most 3 higher then the answer?. But L is only given if the guess is at most 3 
> lower the answer? I'm starting to like this ;D
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to