I had a list
a = [1, 2, 3]
when I did
a.insert(100, 100)
[1, 2, 3, 100]
as list was originally of size 4 and I was trying to insert value at index
100 , it behaved like append instead of throwing any errors as I was trying
to insert in an index that did not even existed .
Should it not thro
On Mon, 15 Sep 2014 02:13:53 +1000
Chris Angelico wrote:
> On Sun, Sep 14, 2014 at 8:13 PM, Brynjar Smári Bjarnason
> wrote:
> > I am using Python 3.4.1 installed with Anaconda. I tried the following
> > (expecting an OrderedDict as result):
> >
> from collections import namedtuple
> NT =
On Sun, Sep 14, 2014 at 8:13 PM, Brynjar Smári Bjarnason
wrote:
> I am using Python 3.4.1 installed with Anaconda. I tried the following
> (expecting an OrderedDict as result):
>
from collections import namedtuple
NT = namedtuple("NT",["a","b"])
nt = NT(1,2)
print(vars(nt))
> {}
>
Hi.
I am using Python 3.4.1 installed with Anaconda. I tried the following
(expecting an OrderedDict as result):
>>>from collections import namedtuple
>>>NT = namedtuple("NT",["a","b"])
>>>nt = NT(1,2)
>>>print(vars(nt))
{}
so the result is an empty dict. In Python 3.3.2 (downgraded in the
same