[Tutor] Can I use def without ( ) at the end?
falcon3166 at hotmail.com
Sun Jul 10 02:33:54 CEST 2005
How do I make Python get a def? Is it the "get" function, or something
else? I need to know so that I can get a def for that computer
MasterMind(tm) game that I'm writing.
BTW, I took your advice, and wrote some definitions for my Giant
Calculator program. Might make the code easier to read, but harder to code
because I have to keep going to the top to read the menu. Not that fun,
necessary for a smooth program, I guess.
----- Original Message -----
From: "Brian van den Broek" <bvande at po-box.mcgill.ca>
To: "Nathan Pinno" <falcon3166 at hotmail.com>
Cc: <tutor at python.org>
Sent: Saturday, July 09, 2005 6:15 PM
Subject: Re: [Tutor] Can I use def without ( ) at the end?
> 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
> No. Why do you want to do this? If it is to have a function with no
> >>> def no_args():
> ... print "I've no arguments"
> >>> no_args()
> I've no arguments
> Brian vdB
More information about the Tutor