Re: what is the difference between the two kinds of brackets?

2007-10-21 Thread Hendrik van Rooyen
Paul Hankin pamail.com wrote: If everything else is equal, use tuples. Interesting point of view - mine is just the opposite. I wonder if its the philosophical difference between: Anything not expressly allowed is forbidden and Anything not expressly forbidden is allowed ? - Hendrik

Re: what is the difference between the two kinds of brackets?

2007-10-21 Thread James Stroud
Hendrik van Rooyen wrote: Paul Hankin pamail.com wrote: If everything else is equal, use tuples. Interesting point of view - mine is just the opposite. I wonder if its the philosophical difference between: Anything not expressly allowed is forbidden and Anything not

Re: what is the difference between the two kinds of brackets?

2007-10-21 Thread Alex Martelli
James Stroud [EMAIL PROTECTED] wrote: ... I wonder if its the philosophical difference between: Anything not expressly allowed is forbidden and Anything not expressly forbidden is allowed ? - Hendrik The latter is how I interpret any religious moral code--life is a lot

what is the difference between the two kinds of brackets?

2007-10-20 Thread [EMAIL PROTECTED]
hi what is the difference between the two kinds of brackets? I tried a few examples but I can't make out any real difference: lst = [10, 20, 30] print lst[0] print lst[2] print lst lst = (10, 20, 30) print lst[0] print lst[2] print lst lst = [10, 20, 40, string, 302.234] print lst[0:2] print

Re: what is the difference between the two kinds of brackets?

2007-10-20 Thread Thomas Jollans
On Saturday 20 October 2007, [EMAIL PROTECTED] wrote: hi what is the difference between the two kinds of brackets? I tried a few examples but I can't make out any real difference: Lists are mutable, tuples aren't: Python 2.4.4 (#2, Aug 16 2007, 00:34:54) [GCC 4.1.3 20070812 (prerelease)

Re: what is the difference between the two kinds of brackets?

2007-10-20 Thread James Stroud
[EMAIL PROTECTED] wrote: hi what is the difference between the two kinds of brackets? I tried a few examples but I can't make out any real difference: Are these two kinds of brackets mean the same thing in the list context? Thanks. The square ones designate lists:

Re: what is the difference between the two kinds of brackets?

2007-10-20 Thread Steve Lamb
On 2007-10-20, James Stroud [EMAIL PROTECTED] wrote: commentaryThe long of it is that there are deep computer-science issues that distinguish the two and the differences become more important the more you know (presumably). However, I have been programming this language for 5 years, and I

Re: what is the difference between the two kinds of brackets?

2007-10-20 Thread Paul Hankin
On Oct 20, 11:15 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: what is the difference between the two kinds of brackets? I tried a few examples but I can't make out any real difference: The main difference in the language between tuples and lists is that tuples (...) are immutable, and lists

Re: what is the difference between the two kinds of brackets?

2007-10-20 Thread Steven D'Aprano
On Sat, 20 Oct 2007 12:43:31 +, Steve Lamb wrote: The quick answer is that tuples can be indexes into directories while lists cannot. A note on terminology: the things inside curly brackets {} are called dictionaries, or dicts, not directories. And the things you use to store data in

Re: what is the difference between the two kinds of brackets?

2007-10-20 Thread Steve Lamb
On 2007-10-21, Steven D'Aprano [EMAIL PROTECTED] wrote: A note on terminology: the things inside curly brackets {} are called dictionaries, or dicts, not directories. And the things you use to store data in dictionaries are called keys, not indexes: Thanks for catching that. Kids, don't