programming logical functions: myand, myor and mynot
Jeff Shannon
jeff at ccvcorp.com
Mon Nov 19 15:07:46 EST 2001
More information about the Python-list mailing list
Mon Nov 19 15:07:46 EST 2001
- Previous message (by thread): programming logical functions: myand, myor and mynot
- Next message (by thread): programming logical functions: myand, myor and mynot
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Gernot wrote: > "Jeff Shannon" <jeff at ccvcorp.com> schrieb im Newsbeitrag > news:3BF429F1.146759EA at ccvcorp.com... > > > > Gernot wrote: > [deleted] > > > module which i have to "activate" first?? > > > > There is no bool() in Python. You'll have to build your own. > > But at least you've got a decent start on your homework. > > You are right, i mixed it up with something different. Thanks for your > comment. Actually, it's even more simple than you think, in Python. def bool(x): if x: return 1 else: return 0 Or, alternatively import operator def bool(x): return operator.truth(x) Jeff Shannon Technician/Programmer Credit International
- Previous message (by thread): programming logical functions: myand, myor and mynot
- Next message (by thread): programming logical functions: myand, myor and mynot
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list