[Tutor] How do I create the equivalent of a Java class in Python?

Alan Gauld alan.gauld at freenet.co.uk
Wed May 17 01:17:05 CEST 2006


> Erm.  Shouldn't that be the following?
> 
> class Msg:
>   def __init__(self,s):
>      self.s = s
>   def say(self):
>      if *not *self.s: print "No message"
>      else: print self.s

Yep, its my week for making mistakes.
Although this one was just a typo...

My only excuse is that I'm really busy with my project at work 
just now so not really checking the tutor code...

Alan G.



More information about the Tutor mailing list