I'm tempted to suggest using a hack to avoid floating point errors.
Anyway, it isn't choosing a number to ten decimal places. It's actually
out to 11 in both examples you gave. And it evaluates to correct because
your guesses were to at least 10 places, which is as far as you account
for in the
I need to start using the reply all button...
Andrew James wrote:
> while guess != number:
>guess = float(raw_input("Make another guess: "))
>if guess > number:
>print "Lower..."
>elif guess < number:
>print "Highe
*headbang*
I'm an idiot. s=s[:-2] should be s=s[:-1].
Andrew James wrote:
> And as soon as I send it again I realise a pretty stupid error. The
> two loops shouldn't be nested.
>
> Andrew James wrote:
>> Helps if I send it to the group...
>>
>> And Ken
And as soon as I send it again I realise a pretty stupid error. The two
loops shouldn't be nested.
Andrew James wrote:
> Helps if I send it to the group...
>
> And Kent, I didn't post it originally because I figured the other guy
> was still working on his script. Beside
Helps if I send it to the group...
And Kent, I didn't post it originally because I figured the other guy
was still working on his script. Besides, I didn't think it'd be that
far fetched for you to assume I was using something like "while s[0] ==
' ':"
Andre
I've gone ahead and created a script that does this, however it also
strips punctuation. I was originally just comparing each character to a
string containing a single space ' ' but even using s[-1].isspace() I
lose punctuation marks. Any idea why that's happening?
(Not the OP, I just thought t