Re: [Tutor] recursion

2016-02-06 Thread Danny Yoo
On Thu, Feb 4, 2016 at 6:03 PM, noopy via Tutor wrote: > Hi, > > I just cannot get my head around the following code, maybe someone could > explain it to me. One thing to note: the function here is a generator, which is itself an intermediate subject that's specific to Python. Recursion is a mor

Re: [Tutor] recursion

2016-02-06 Thread Danny Yoo
On Feb 5, 2016 12:07 AM, "noopy via Tutor" wrote: > > Hi, > > I just cannot get my head around the following code, maybe someone could explain it to me. > > def permutations(items): When trying to understand a function (or in this case, a generator), knowing the types of input and output can be h

Re: [Tutor] Need help with two similar test cases that I have written. One works and the other fails

2016-02-06 Thread boB Stepp
On Sat, Feb 6, 2016 at 3:54 PM, boB Stepp wrote: > On Sat, Feb 6, 2016 at 10:07 AM, Anubhav Yadav wrote: Just read Danny's reply after sending mine, which means that the answer to my question: > If my understanding is indeed correct, then I will leave it to you to > figure out which logic opera

Re: [Tutor] Need help with two similar test cases that I have written. One works and the other fails

2016-02-06 Thread boB Stepp
On Sat, Feb 6, 2016 at 10:07 AM, Anubhav Yadav wrote: > class TestCase(unittest.TestCase): > def test_red_temperature_simulation(self): > """ > Method to test the red_temperature_simulation method > """ > for i in range(10): > self.assertLess(r

Re: [Tutor] Need help with two similar test cases that I have written. One works and the other fails

2016-02-06 Thread Danny Yoo
On Feb 6, 2016 12:31 PM, "Anubhav Yadav" wrote: > > Hello Everyone, > > I am trying to write a simple program that generated random numbers based > on some rules. > when my program is in the yellow state, it should generate the numbers > from 100.0-100.5 > and 102.5-103.0. When my program is in th

[Tutor] Need help with two similar test cases that I have written. One works and the other fails

2016-02-06 Thread Anubhav Yadav
Hello Everyone, I am trying to write a simple program that generated random numbers based on some rules. when my program is in the yellow state, it should generate the numbers from 100.0-100.5 and 102.5-103.0. When my program is in the red state, it should generate numbers in the range less than 9

Re: [Tutor] installing rtree on python 34

2016-02-06 Thread Bachir Bachir via Tutor
Hello AlainI am using windows10 64 bits, my os.name is 'nt', I used pip to   install but its complaining about the spatialindex_c.dll     File "C:\Users\Bachir\AppData\Local\Temp\pip-build-td64lrth\rtree\rtree\core.py", line 101, in        raise OSError("could not find or load spatialindex_c.dll

Re: [Tutor] installing rtree on python 34

2016-02-06 Thread Alan Gauld
On 06/02/16 06:47, Bachir Bachir via Tutor wrote: > Dear all,I am using winpython 34 , could anyone help installing rtree please? > It seems rtree loading libspatialindex , > i donwnloaded the libspatial index but rtree still cant find > the files locationthanks much for your helpsincerelyBachir

[Tutor] installing rtree on python 34

2016-02-06 Thread Bachir Bachir via Tutor
 Dear all,I am using winpython 34 , could anyone help installing rtree please?It seems rtree loading libspatialindex , i donwnloaded the libspatial index but rtree still cant find the files locationthanks much for your helpsincerelyBachir ___ Tutor mai