Re: Struggling with basics

Discussion in 'Python' started by Jason, Sep 25, 2005.

1. JasonGuest

Rather than reply to those individuals, just a big "thanks" to those
that have helped.

It's definitely making sense, the fact that I need to show the
two-element tuple to show correctly was one of those head-slapping moments.

And Dennis Lee Bieber hit the nail on the head when he mentioned that
I'd declared the initial scores as strings, yet I was comparing them
against integers. I simply removed the single-quotes from the scores
and everything slotted into place.

Again, I now have the list working, apart from the list is reversed (as
per Dennis Lee Bieber mentioned). I'm afraid I don't understand what
you mean about the DIFF report but I'll investigate further and learn a
bit more.

Again, thanks for the assistance.

Jason, Sep 25, 2005

2. Reinhold BirkenfeldGuest

Jason wrote:
> Rather than reply to those individuals, just a big "thanks" to those
> that have helped.
>
> It's definitely making sense, the fact that I need to show the
> two-element tuple to show correctly was one of those head-slapping moments.
>
> And Dennis Lee Bieber hit the nail on the head when he mentioned that
> I'd declared the initial scores as strings, yet I was comparing them
> against integers. I simply removed the single-quotes from the scores
> and everything slotted into place.
>
> Again, I now have the list working, apart from the list is reversed (as
> per Dennis Lee Bieber mentioned). I'm afraid I don't understand what
> you mean about the DIFF report but I'll investigate further and learn a
> bit more.

Please bear in mind: If you just remove the quotes from '00050', you will get
a value of 40. This is because integer literals with leading zeroes are inter-
preted as octal.

Reinhold

Reinhold Birkenfeld, Sep 25, 2005

3. JasonGuest

Reinhold Birkenfeld wrote:
> Jason wrote:
>> Rather than reply to those individuals, just a big "thanks" to those
>> that have helped.
>>
>> It's definitely making sense, the fact that I need to show the
>> two-element tuple to show correctly was one of those head-slapping moments.
>>
>> And Dennis Lee Bieber hit the nail on the head when he mentioned that
>> I'd declared the initial scores as strings, yet I was comparing them
>> against integers. I simply removed the single-quotes from the scores
>> and everything slotted into place.
>>
>> Again, I now have the list working, apart from the list is reversed (as
>> per Dennis Lee Bieber mentioned). I'm afraid I don't understand what
>> you mean about the DIFF report but I'll investigate further and learn a
>> bit more.

>
> Please bear in mind: If you just remove the quotes from '00050', you will get
> a value of 40. This is because integer literals with leading zeroes are inter-
> preted as octal.
>
> Reinhold

Doh!

Just found that out! lol.

OK I'm going to read a bit more in the manual now; I'm determined to
crack this nut by the morning.

Jason, Sep 25, 2005
4. Dennis Lee BieberGuest

On Sun, 25 Sep 2005 22:16:05 +0100, Jason <>
declaimed the following in comp.lang.python:

> you mean about the DIFF report but I'll investigate further and learn a
> bit more.
>

DIFF is a common utility on many systems (though it took me a while
to find one I could use on my home system... (I need to check deeper
into if the VS2005 beta, or what ever, includes WinDiff -- I finally
tricked the NetBeans system into running its Diff on Python files).

Diff compares (in simple cases) two files line by line, and
generates a report of where the files are different. Note: it has to
make multiple passes because adding and deleting lines means a lot is
still the same, but they aren't the same "line number".

I ran diff on your source (as copied from the message) against my
source (a copy of yours with my edits in place). Then supplied the
report. Essentially, a type of patch program (assuming your actual file
matched what I pulled from the message, though I doubt that) could
process the report automatically, converting your file into mine by
removing lines with < in front of them, inserting lines with >...
--
> ============================================================== <
> | Wulfraed Dennis Lee Bieber KD6MOG <
> | Bestiaria Support Staff <
> ============================================================== <