"Siren Saren" <sire...@yahoo.com> wrote
unrelated thanks: your website has been a great help
Thanks for the kind words :-)
The idea of making this into an object appeals to me
very much, because I've been trying to get my head around
creating objects as well as just using them.
It has some advantages since it is possible to write functions
that are used when sorting so you can sort complex data sets
relatively easily at the macro scale of using the objects. The
comparison functions useed to sort may of course be arbitrarily
complex - but at least the higher level application code is kept
simple..
I'm positive now that my initial message was misleading,
given that you also responded as though I could affect
the way my data arrived.
You gave no clue whatsoever how the data arrived.
Is it in a file? a data stream? a database?
The first thing to do in any data processing application is to read
the data into the data format that you want it to be in to do the
processing.
Oddly, I've already tried to develop a couple of 'programs' dealing
with data in this form-- lists where the sequence means something
but isn't merely alternation.
I'm still not sure I understand what you mean by that. Your book/pages
and crypto examples seemed straighforward but you didn't give any
examples of what the sorted v unsorted data would look like.
I assumed this must be a common problem but maybe
programmers mostly deal with data that was made for their
purposes nowadays.
Not at all but the first thing you do in any data processing problem
is take the input data and store it how you want it, not how it
arrives!
But how you want it will depend on what you are trying to do with it!
That's why the many responses vary - it depends on how you want
to manipulate it.
HTH,
--
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/
_______________________________________________
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor