Re: [Tutor] Tutor Digest, Vol 104, Issue 65

2012-10-17 Thread Osemeka Osuagwu
On Tue, 16 Oct 2012 10:30:54 +0100 Alan Gauld wrote Yes but then it wouldn't be OOP. You'd be back in the world of traditional procedural programming passing explicit data references around. Its much better to make it an instance method with the self reference being passed implicitly I

Re: [Tutor] Tutor Digest, Vol 104, Issue 60

2012-10-16 Thread Osemeka Osuagwu
here. thank you Steven --- On Sun, 14 Oct 2012 16:21:38 +0100 Alan Gauld wrote: On 14/10/12 13:34, Osemeka Osuagwu wrote: I understand instance, static and class methods but I'm still struggling with when and where they should be used. You can pretty much ignore static

[Tutor] instance method call issue

2012-10-14 Thread Osemeka Osuagwu
Hello people, Firstly, thank you so much for all the assistance you provide so selflessly through this medium. I come from a functional programming background and have only recently become serious with OOP. For practice, I tried to implement John Conways 'Game of Life' without a GUI and ran into

[Tutor] Error in apparently correct code

2012-08-20 Thread Osemeka Osuagwu
Dear Pythonistas (I hope you don't mind that), I wrote the following code to find the four adjacent numbers (in any direction in the array) which, when multiplied together, would yield the highest product to be gotten. I finally stumbled on the answer while studying the data itself but I'm still

Re: [Tutor] Tutor Digest, Vol 102, Issue 48

2012-08-20 Thread Osemeka Osuagwu
Dear Mark, I can't see a Python array anywhere. Do you mean the list of lists? :) THE CODE [snipped as it's been mangled, was it posted in html and not plain text or what? I'm too lazy to unmangle it, others might be kinder] Again, my bad. Here's the code in plain text:

[Tutor] Invalid Token Problem

2012-07-19 Thread Osemeka Osuagwu
Hi folks, I've been trying to convert numbers from digits to words, I wrote the following code; units = ['one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine'] teens = ['eleven', 'twelve', 'thirteen', 'fourteen', 'fifteen', 'sixteen', 'seventeen', 'eighteen', 'nineteen'] tens =

[Tutor] Bothersome NoneType Error for a List object

2012-07-04 Thread Osemeka Osuagwu
Hi, I am trying to find the smallest positive number that is divisible by all of the numbers from 1 to 20 without a remainder. I wrote the following code (implementation of a solution method found in http://en.wikipedia.org/wiki/Least_common_multiple#A_method_using_a_table ) but kept getting an

Re: [Tutor] VPYTHON (Emile van Sebille)

2012-07-04 Thread Osemeka Osuagwu
Sebille) 4. Bothersome NoneType Error for a List object (Osemeka Osuagwu) 5. Re: Bothersome NoneType Error for a List object (Steven D'Aprano) 6. Re: Seeking help with reading and writing files in Python (Alan Gauld

Re: [Tutor] Tutor Digest, Vol 101, Issue 12

2012-07-04 Thread Osemeka Osuagwu
] Bothersome NoneType Error for a List object Message-ID: jt1tk0$fnd$1...@dough.gmane.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed On 04/07/12 17:01, Osemeka Osuagwu wrote: lcm = reduce(lambda x, y: x*y, templist) #my first lambda expression! (multiply all

Re: [Tutor] Tutor Digest, Vol 98, Issue 70

2012-04-28 Thread Osemeka Osuagwu
-1; format=flowed Osemeka Osuagwu wrote: Hi, I started learning Python recently, having only very little programming experience. I installed Pygame and tried using How did you install it? What operating system are you using? import pygame to test the installation and got the following

[Tutor] Pygame installation problems

2012-04-27 Thread Osemeka Osuagwu
Hi, I started learning Python recently, having only very little programming experience. I installed Pygame and tried using import pygame to test the installation and got the following error in return; Traceback (most recent call last): File stdin, line 1, in module ImportError: No module