[Tutor] List of ints
Phil
phil_lor at bigpond.com
Wed Mar 4 00:09:03 CET 2015
On 03/03/15 17:46, Mark Lawrence wrote:
>
> You are trying to increment the first element of count which is itself a
> list containing one element. You actually need:-
>
> count[0][0] +=1
>
Thank you Lawrence, Alan, and Danny,
The solution is embarrassingly obvious. It's been a long time since I've
attempted any programming and I'd even forgotten that I needed a nested
loop to access the cells in a two-dimensional array, or list. In this
case I didn't need a two-dimensional array anyway.
I'd been away from home for five weeks and during a quiet period I
installed QPython on my tablet with the aim of porting a programme that
I'd written in C++ 15 years ago to Python. Cutting and pasting and even
moving around the IDE turned out to be a truly frustrating exercise.
I wonder if it was just my clumsiness or if others have had the same
experience?
--
Regards,
Phil
More information about the Tutor
mailing list