Re: [Tutor] Python 3 - bugs or installation problem

2015-03-05 Thread Alan Gauld
On 05/03/15 01:53, Phil wrote: I hope this is not another embarrassingly obvious answer to a simple question. Python 3, under Kubuntu. xrange() fails whereas range() is accepted. Could this be an installation problem? There are many incompatible changes in Python v3 compared with v2. Some are

Re: [Tutor] Strengths & weaknesses of Python lists compared to "old school" arrays [Was "Fixed Vector Array"]

2015-03-05 Thread Alan Gauld
On 04/03/15 19:10, boB Stepp wrote: learned of programming via FORTRAN and BASIC (various incarnations). These used multidimensional array-based thinking. ... I don't recollect anything similar to Python lists There weren't, and it was a common programming exercise to create them using arra

Re: [Tutor] Strengths & weaknesses of Python lists compared to "old school" arrays [Was "Fixed Vector Array"]

2015-03-05 Thread Steven D'Aprano
On Wed, Mar 04, 2015 at 01:10:11PM -0600, boB Stepp wrote: > What are the strengths and weaknesses of Python lists compared to "old > school" arrays? Python lists are objects, containing a sequence of objects. Objects are "fatter" than low-level data like machine ints. (They take up more space.

Re: [Tutor] Strengths & weaknesses of Python lists compared to "old school" arrays [Was "Fixed Vector Array"]

2015-03-05 Thread Alan Gauld
On 05/03/15 12:20, Steven D'Aprano wrote: index position. In other words does the array need to be filled in a sequential manner or could you have a 'hole' in the middle... I'm not really sure that arrays can have holes in them. Basic low-level arrays, like found in Pascal, C or Fortran, canno

Re: [Tutor] Python 3 - bugs or installation problem

2015-03-05 Thread Jerry Hill
On Wed, Mar 4, 2015 at 8:53 PM, Phil wrote: > phil@Asus:~/Python$ python3 > Python 3.4.2 (default, Oct 8 2014, 13:18:07) > [GCC 4.9.1] on linux > Type "help", "copyright", "credits" or "license" for more information. for row in xrange(0,12): > ... print(row) > ... > Traceback (most recen

Re: [Tutor] Strengths & weaknesses of Python lists compared to "old school" arrays [Was "Fixed Vector Array"]

2015-03-05 Thread boB Stepp
Thank you very much Alan and Steve for your detailed answers. You have clarified many things and sent me off searching for more information on variant records, tagged and untagged unions, sparse arrays, linked lists, how memory allocation is affected by these topics and some other items. And I wo

Re: [Tutor] Python 3 - bugs or installation problem

2015-03-05 Thread Mark Lawrence
On 05/03/2015 08:10, Alan Gauld wrote: On 05/03/15 01:53, Phil wrote: I hope this is not another embarrassingly obvious answer to a simple question. Python 3, under Kubuntu. xrange() fails whereas range() is accepted. Could this be an installation problem? There are many incompatible changes

Re: [Tutor] Strengths & weaknesses of Python lists compared to "old school" arrays [Was "Fixed Vector Array"]

2015-03-05 Thread Mark Lawrence
On 05/03/2015 10:07, Alan Gauld wrote: On 04/03/15 19:10, boB Stepp wrote: wanted to address an item in a 3-dimensional array, I would use something like (x, y, z) whereas the Python list form amounts to [x][y][z] . That's just a syntax thing, Python could have allowed single bracketing of ind

Re: [Tutor] Strengths & weaknesses of Python lists compared to "old school" arrays [Was "Fixed Vector Array"]

2015-03-05 Thread Albert-Jan Roskam
Original Message - > From: Mark Lawrence > To: tutor@python.org > Cc: > Sent: Thursday, March 5, 2015 9:54 PM > Subject: Re: [Tutor] Strengths & weaknesses of Python lists compared to "old > school" arrays [Was "Fixed Vector Array"] > > On 05/03/2015 10:07, Alan Gauld wrote: >> On