[Tutor] Function output

alan.gauld@bt.com alan.gauld@bt.com
Wed, 28 Jun 2000 11:30:13 +0100


> >From Idle screen:
> 
> 
> >>> class rollum:
>  def funct1 (self):
>   s = " Hello World"
>   return s
>  def output (self):
>   a = funct1()
>   return a
>  
>  
> >>> rollum.output()

Others have picked up most of the points but for emphasis: 
the output function just returns a value. If you want to see 
that (outside of IDLE) you will need to use print.

Thus it should be:

>>> r = rollum()
>>> print r.output()


Alan G.