Re: [Tutor] Actual code that illustrates problem

2006-08-18 Thread Kermit Rose
Alan Gauld wrote: > #print " " #print " In strongfac " #print " Found1: x = ",x >>> >>> You could do all of this with a single print: >>> >>> print "\n In strongfac \nFound1: x = ", x >>> >> uh.. Too compact for me. >> I nee

Re: [Tutor] Actual code that illustrates problem

2006-08-18 Thread Kent Johnson
Alan Gauld wrote: #print " " #print " In strongfac " #print " Found1: x = ",x >>> You could do all of this with a single print: >>> >>> print "\n In strongfac \nFound1: x = ", x >>> >>> >> uh.. Too compa

Re: [Tutor] Actual code that illustrates problem

2006-08-18 Thread Alan Gauld
>>> #print " " >>> #print " In strongfac " >>> #print " Found1: x = ",x >> >> You could do all of this with a single print: >> >> print "\n In strongfac \nFound1: x = ", x >> > uh.. Too compact for me. > I need to see the logic more spread

Re: [Tutor] Actual code that illustrates problem

2006-08-17 Thread Kermit Rose
Alan Gauld wrote: > > While others have made good suggestions to clarify the code I thought > I'd try to tackle the question of whether we had a bug in Python. > > Unfortunately the debug output does not come from the code that's > posted so its difficult to figure out what's been happening. > > Fo

Re: [Tutor] Actual code that illustrates problem

2006-08-17 Thread Alan Gauld
While others have made good suggestions to clarify the code I thought I'd try to tackle the question of whether we had a bug in Python. Unfortunately the debug output does not come from the code that's posted so its difficult to figure out what's been happening. For example, one apparently good a

Re: [Tutor] Actual code that illustrates problem

2006-08-17 Thread Danny Yoo
# face = [x,y,0] >>> [some code cut] # face[0] = x # face[1] = y # face[2] = 0 > > I agree. I reasoned as follows. > > The root cause is that Python is not returning the correct value of a list. > > So before I return the list, I will remind Python what's in the list. Hi Kermi

Re: [Tutor] Actual code that illustrates problem

2006-08-17 Thread Kermit Rose
Danny Yoo wrote: > > > Hi Kermit, > > Ok, good. You should add this as a comment to the function's header, > so that other people can see this. Here is an example: > > def strongfac(z, w): > """z is the number to be factored. >w is a witness that may help find the factors of z. >

Re: [Tutor] Actual code that illustrates problem

2006-08-17 Thread Danny Yoo
> To try to find factors of z, using w. > > > * What are the inputs? What is 'z', and what is 'w'? > > ** > > z is the number to be factores. > > w is a "witness", a number that may help find the factors of z. [My apologies in advance; this message is a bit long.] Hi Kermit, Ok, goo

Re: [Tutor] Actual code that illustrates problem

2006-08-17 Thread Kermit Rose
>>> From: Danny Yoo Date: 08/17/06 04:02:35 To: Kermit Rose Cc: Tutor Subject: Re: [Tutor] Actual code that illustrates problem > # def strongfac(z,w): [function body cut] Ok, let's go through this step by step. * What is the intent of strongfac? *** To tr

Re: [Tutor] Actual code that illustrates problem

2006-08-17 Thread Danny Yoo
> #def strongfac(z,w): [function body cut] Ok, let's go through this step by step. * What is the intent of strongfac? * What are the inputs? What is 'z', and what is 'w'? * What are the outputs? What is the return value of strongfac? Same questions for fermat(). What are th

[Tutor] Actual code that illustrates problem

2006-08-16 Thread Kermit Rose
Message: 11 Date: Tue, 15 Aug 2006 11:50:47 +1200 From: "John Fouhy" <[EMAIL PROTECTED]> Subject: Re: [Tutor] Global variables Cc: tutor@python.org Can you post actual code to illustrate the problem? Don't post your entire module; just show us the functions involved, the input that causes t