[Tutor] Can I use def without ( ) at the end?

Brian van den Broek bvande at po-box.mcgill.ca
Sun Jul 10 02:15:54 CEST 2005


Nathan Pinno said unto the world upon 09/07/2005 19:03:
> Hi all,
> 
> Is the subject possible without getting an error?
> 
> Nathan Pinno
> Crew, McDonalds Restaurant, Camrose, AB Canada
> http://www.npinnowebsite.ca/

No. Why do you want to do this? If it is to have a function with no 
arguments:

 >>> def no_args():
... 	print "I've no arguments"
... 	
 >>> no_args()
I've no arguments
 >>>

Brian vdB



More information about the Tutor mailing list