People hunting for Python projects to work on might get a kick out of
this puzzle:
http://www.wired.com/geekdad/2012/08/geekdad-puzzle-of-the-week-extreme-products/
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
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
On 20/08/2012 21:24, Osemeka Osuagwu wrote:
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
I can't see a Python array anywhere. Do you mean the list of
Your problem is in this line, as the traceback shows:
return reduce(lambda x,y:x*y, [data[row][i] for i in range(col, col+4)])
So the thing you have to think about is - what values can col be? The
answer is then in this line:
for col in range(len(data[row]))
And since each row of your data
On 20/08/2012 22:06, Rob Day wrote:
Your problem is in this line, as the traceback shows:
return reduce(lambda x,y:x*y, [data[row][i] for i in range(col, col+4)])
So the thing you have to think about is - what values can col be? The
answer is then in this line:
for col in
On Monday 2012 August 20 14:27, Mark Lawrence wrote:
Give a man a fish, and you feed him for a day; show him how to catch
fish, and you feed him for a lifetime.
--
Cheers.
Mark Lawrence.
Teach a man to steal fish and he will live until he dies.
--
Yonder nor sorghum stenches shut ladle
On 21/08/12 06:24, Osemeka Osuagwu wrote:
[...]
p.s I apologise for the lack of comments
Don't apologise for lack of comments, apologise for posting in HTML which
causes your code to be mangled, leading indentation stripped, and generally
turned into an unreadable mess.
Indentation has
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:
The code:
curDir = os.getcwd()
znDir = shutil.abspath('../')
baseDir = shutil.abspath('../../')
Files = glob.iglob(os.path.join(znDir, '*'))
print Files
for moveFile in Files:
print moveFile
shutil.move(moveFile, curDir)
Nothing happens. The 'print...moveFile' never