newbie: suppressing return values

Jim Benson jbenson at sextans.lowell.edu
Wed Dec 3 21:41:13 EST 2003



Hi,

  I have a simple newbie question:
It appears that in general functions "show"
their return values. i.e.

>>> def makeList():
...     list = [1,2,3]
...     return list
...
>>>
>>> makeList()
[1, 2, 3]
>>> a = makeList()
>>>

In mathematica one can put a ; at the end of
a function call and the output is suppressed.
In this example if python behaved like mathematica in 
this case one would see:

>>> makeList();
>>>
>>> makeList()
[1, 2, 3]
>>>

Is there a simple way (other than the a = makeList())
to do this "suppression" in python?

Thanks,

Jim








More information about the Python-list mailing list