Re: [Tutor] Python

2017-12-01 Thread Steven D'Aprano
On Thu, Nov 30, 2017 at 09:20:32AM +0100, Jeroen van de Ven wrote: > Hello, > Can you build these 4 programms for me? Certainly. My rate is AUD$175 an hour, payable in advance. I estimate that it will take at least three hours to write and test the first three programs. You haven't shown the

Re: [Tutor] Counting iterations of a function

2017-12-01 Thread Steven D'Aprano
On Thu, Nov 30, 2017 at 10:26:20AM -0600, Michael Dowell wrote: > Hello, I'm trying to code a magic 8-ball program and it needs to include a > counter for the number of questions asked. I'm having a hard time > implementing a count, and need a little help. I had tried to implement it > in the

Re: [Tutor] Problem with 'IF' condition

2017-12-01 Thread Steven D'Aprano
On Fri, Dec 01, 2017 at 07:02:47AM -0700, a.ajm...@incycleautomation.com wrote: > I copied my program as plain text below, Unfortunately you didn't, as the text you quote below will not run as Python code due to indentation errors. So you have (accidentally, I trust) messed up the indentation.

Re: [Tutor] Problem with 'IF' condition

2017-12-01 Thread Peter Otten
a.ajm...@incycleautomation.com wrote: > I am trying to compare two different values using "IF" condition in my > program. Everything is working fine except this. I copied my program as > plain text below Your code has indentation errors, my analysis assumes # the following was added to make it

Re: [Tutor] Problem with 'IF' condition

2017-12-01 Thread Alan Gauld via Tutor
On 01/12/17 14:02, a.ajm...@incycleautomation.com wrote: > - If you see in my code, I'm writing to "test1.txt" and saving that value in > "nao" as well. > On the other side, I'm reading from "test3.txt" and saving that value in > "abb" just like above. > > Now, my goal is to compare these two

[Tutor] Problem with 'IF' condition

2017-12-01 Thread a.ajmera
Hi, I am trying to compare two different values using "IF" condition in my program. Everything is working fine except this. I copied my program as plain text below, in the last section I used "IF" condition. - If you see in my code, I'm writing to "test1.txt" and saving that value in "nao" as

Re: [Tutor] problem with a sub-class

2017-12-01 Thread Sydney Shall
On 30/11/2017 22:08, Alan Gauld via Tutor wrote: On 30/11/17 15:37, Shall, Sydney wrote: My problem is with constructing a sub-class. My sub-class is constructed as follows: import Population_ProductivityV24 as POCWP Note that POCWP is an alias for the *module* Population_ProductivityV24.

[Tutor] [cleaned-up] Re: problem with a sub-class

2017-12-01 Thread Peter Otten
Peter Otten wrote: Sorry for the mess; second attempt: A class is an instance of its metaclass. class A: pass is roughly equivalent to A = type("A", (), {}) # classname, base classes, class attributes and class B(A): foo = 42 is roughly equivalent to B = type(A)("B", (A,), {"foo":

Re: [Tutor] problem with a sub-class

2017-12-01 Thread Peter Otten
Alan Gauld via Tutor wrote: > On 30/11/17 15:37, Shall, Sydney wrote: > >> My problem is with constructing a sub-class. >> >> My sub-class is constructed as follows: >> >> import Population_ProductivityV24 as POCWP > > Note that POCWP is an alias for the *module* Population_ProductivityV24. >