On Wed, Mar 16, 2011 at 1:24 AM, Donald Bedsole wrote:
>
> Ok, so, as another example:
>
> not(True and False) is "True"
>
> because: the first argument "True" is true, and the second argument
> "False" when returned is negated by "not" becomes "not False" which
> evaluates to True?
>
>
Correct.
Hi Jack,
On Wed, Mar 16, 2011 at 1:50 AM, Jack Trades wrote:
> On Wed, Mar 16, 2011 at 12:22 AM, Donald Bedsole
> wrote:
>
>> not (False and True)
>>
>> Python evaluates it as "True"
>
>
>>
>> 1)You evaluate what's in the parentheses first. A thing can not be
>> false and true at the same time,
On Wed, Mar 16, 2011 at 12:22 AM, Donald Bedsole wrote:
>
> not (False and True)
>
> Python evaluates it as "True"
>
> Is it because:
> 1)You evaluate what's in the parentheses first. A thing can not be
> false and true at the same time, so the answer is false.
>
Yes, the expression in the paren
Hi folks,
I'm working on Boolean Operators right now, and I'm getting it for the
most part. But, could someone make sure I'm understanding this one
expression correctly?
not (False and True)
Python evaluates it as "True"
Is it because:
1)You evaluate what's in the parentheses first. A thing ca
Ryan,
Did you enter it like this at the prompt:
>>> chaos.main() statement
If so, that's a problem. Your function was called: "main()", so if
you type chaos.main(), Python doesn't know what you're talking about.
___
Tutor maillist - Tutor@python.or
Hi Ryan,
Also, when it works correctly, IDLE won't run the program again via
the >>> chaos.main() statement. I get this:
Traceback (most recent call last):
File "", line 1, in
chaos.main()
NameError: name 'chaos' is not defined
I think IDLE is looking for a file name to run. If your file
This following post was originally posted to the wrong thread.
I am reposting (hopefully correctly) with the first and very
succint response. I thing the answer is a revealation to
be noted:
##
On Tue, Mar 15, 2011 at 8:00 PM, Tim Johnson wr
* Wayne Werner [110315 17:29]:
> On Tue, Mar 15, 2011 at 8:00 PM, Tim Johnson wrote:
>
> > What is the difference between using
> > hasattr(object, name)
> > and
> > name in dir(object)
> >
>
> hasattr is basically
>
> try:
> object.name
> return True
> except AttributeError:
>
I'm a newbie running my very first module . . .
Specs:
Mac OSX 10.6.6
Python 3.2
IDLE v 3.2
Tk v 8.5
I saved this module to my desktop
> # File: chaos.py
> # A simple program illustrating chaotic behavior.
>
> def main():
> print("This program illustrates a chaotic function")
> x = eval(
On Tue, Mar 15, 2011 at 8:00 PM, Tim Johnson wrote:
> What is the difference between using
> hasattr(object, name)
> and
> name in dir(object)
>
hasattr is basically
try:
object.name
return True
except AttributeError:
return False
while "name in dir(object)" is (AFAIK) more lik
What is the difference between using
hasattr(object, name)
and
name in dir(object)
?
TIA
--
Tim
tim at johnsons-web dot com or akwebsoft dot com
http://www.akwebsoft.com
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription
On Tue, Mar 15, 2011 at 7:00 PM, Carla Jenkins wrote:
> Are there specific Python commands to process present value, future value
> and net present value? Thanks.
>
http://tinyurl.com/4j5exao
http://tinyurl.com/67x2to8
HTH,
Wayne
>
> Sincerely,
> Carla Jenkins
>
>
> __
Are there specific Python commands to process present value, future value and
net present value? Thanks.
Sincerely,
Carla Jenkins
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mai
I hate to jump on this one a little late, but even getattr() is kind
of ghetto (though exec/eval is worse ;).
For setting up shell scripts or CLIs, the usual route is the optparse module.
- Japhy
2011/3/15 Yaşar Arabacı :
> Thanks for excellent explanations. I almost got this working. I just hav
Thanks for excellent explanations. I almost got this working. I just
have one more problem, that is:
When user enter incorrect number of arguments for a method, I naturally
get a type error. I could probably fix that with try and catch, but that
is not very explanatory to the user. Is there a
Steven D'Aprano wrote:
> Most of the common built-in Python objects are immutable:
> ...
> while a few are mutable:
>
> lists
> dicts
> sets
Also, bytearrays.
--
Tom Zych / freethin...@pobox.com
___
Tutor maillist - Tutor@python.org
To unsubscribe
16 matches
Mail list logo