Re: Class Definitions

2020-11-14 Thread Terry Reedy
On 11/14/2020 4:09 AM, Manfred Lotz wrote: On 11 Nov 2020 19:21:57 GMT r...@zedat.fu-berlin.de (Stefan Ram) wrote: In my Python course I gave the assignment to define a counter class "Main" so that counter0 = Main() counter1 = Main() counter1.count(); counter1.count(); counter1.count() c

Re: Class Definitions

2020-11-14 Thread Manfred Lotz
On Sat, 14 Nov 2020 05:08:07 -0600 2qdxy4rzwzuui...@potatochowder.com wrote: > On 2020-11-14 at 10:09:32 +0100, > Manfred Lotz wrote: > > > On 11 Nov 2020 19:21:57 GMT > > r...@zedat.fu-berlin.de (Stefan Ram) wrote: > > > > > In my Python course I gave the assignment to define a > > > cou

Re: Class Definitions

2020-11-14 Thread 2QdxY4RzWzUUiLuE
On 2020-11-14 at 10:09:32 +0100, Manfred Lotz wrote: > On 11 Nov 2020 19:21:57 GMT > r...@zedat.fu-berlin.de (Stefan Ram) wrote: > > > In my Python course I gave the assignment to define a > > counter class "Main" so that > > > > counter0 = Main() > > counter1 = Main() > > counter1.count();

Re: Class Definitions

2020-11-14 Thread Manfred Lotz
On 11 Nov 2020 19:21:57 GMT r...@zedat.fu-berlin.de (Stefan Ram) wrote: > In my Python course I gave the assignment to define a > counter class "Main" so that > > counter0 = Main() > counter1 = Main() > counter1.count(); counter1.count(); counter1.count() > counter1.count(); counter1.count()

Re: Class Definitions

2020-11-12 Thread dn via Python-list
On 13/11/2020 08:47, Alan Bawden wrote: r...@zedat.fu-berlin.de (Stefan Ram) writes: I expected this solution: class Main: def __init__( self ): self.value = 0 def count( self ): self.value += 1 but a student turned in the following so

Re: Class Definitions

2020-11-12 Thread Alan Bawden
r...@zedat.fu-berlin.de (Stefan Ram) writes: I expected this solution: class Main: def __init__( self ): self.value = 0 def count( self ): self.value += 1 but a student turned in the following solution: class Main: value = 0 def