cool-RR wrote:
> I'm curious. If I append an item to a list from the left using
> `list.insert`, will Python always move the entire list one item to the
> right (which can be super-slow) or will it check first to see whether it
> can just allocate more memory to the left of the
On Friday, February 7, 2014 6:52:24 AM UTC+2, Dan Stromberg wrote:
> On Thu, Feb 6, 2014 at 3:59 PM, cool-RR wrote:
>
> I'm pretty sure it'll slide all the existing elements right one
> position, and add at the leftmost position just opened up - assuming
> you're inserting at position 0.
>
> As
On Thu, Feb 6, 2014 at 3:59 PM, cool-RR wrote:
> Hi,
>
> I'm curious. If I append an item to a list from the left using `list.insert`,
> will Python always move the entire list one item to the right (which can be
> super-slow) or will it check first to see whether it ca
Roy Smith wrote:
O(-1). In Soviet Russia, operation performs you!
It's rumoured that the PSU is developing a time
machine module that can achieve O(-n), but
--
https://mail.python.org/mailman/listinfo/python-list
On Fri, Feb 7, 2014 at 2:29 PM, Rustom Mody wrote:
> On Friday, February 7, 2014 8:44:43 AM UTC+5:30, Chris Angelico wrote:
>> On Fri, Feb 7, 2014 at 2:00 PM, Roy Smith wrote:
>> > Dave Angel wrote:
>> >> list does not promise better than O(1) behavior
>> > I'm not aware of any list implementati
cool-RR Wrote in message:
> Hi,
>
> I'm curious. If I append an item to a list from the left using `list.insert`,
> will Python always move the entire list one item to the right (which can be
> super-slow) or will it check first to see whether it can just allocate more
On Friday, February 7, 2014 8:44:43 AM UTC+5:30, Chris Angelico wrote:
> On Fri, Feb 7, 2014 at 2:00 PM, Roy Smith wrote:
> > Dave Angel wrote:
> >> list does not promise better than O(1) behavior
> > I'm not aware of any list implementations, in any language, that
> > promises better than O(1) b
On Friday, February 7, 2014 5:00:56 AM UTC+2, Roy Smith wrote:
> In article ,
>
> Dave Angel wrote:
> > list does not promise better than O(1) behavior
> I'm not aware of any list implementations, in any language, that
> promises better than O(1) behavior for any operations. Perhaps there is
>
On Fri, Feb 7, 2014 at 2:11 PM, Tim Chase wrote:
> On 2014-02-06 22:00, Roy Smith wrote:
>> > list does not promise better than O(1) behavior
>>
>> I'm not aware of any list implementations, in any language, that
>> promises better than O(1) behavior for any operations. Perhaps
>> there is O(j),
On Fri, Feb 7, 2014 at 2:00 PM, Roy Smith wrote:
> In article ,
> Dave Angel wrote:
>
>> list does not promise better than O(1) behavior
>
> I'm not aware of any list implementations, in any language, that
> promises better than O(1) behavior for any operations. Perhaps there is
> O(j), where y
In article ,
Tim Chase wrote:
> On 2014-02-06 22:00, Roy Smith wrote:
> > > list does not promise better than O(1) behavior
> >
> > I'm not aware of any list implementations, in any language, that
> > promises better than O(1) behavior for any operations. Perhaps
> > there is O(j), where yo
In article ,
Dave Angel wrote:
> list does not promise better than O(1) behavior
I'm not aware of any list implementations, in any language, that
promises better than O(1) behavior for any operations. Perhaps there is
O(j), where you just imagine the operation was performed?
--
https://mail
On 2014-02-06 22:00, Roy Smith wrote:
> > list does not promise better than O(1) behavior
>
> I'm not aware of any list implementations, in any language, that
> promises better than O(1) behavior for any operations. Perhaps
> there is O(j), where you just imagine the operation was performed?
On Friday, February 7, 2014 8:30:56 AM UTC+5:30, Roy Smith wrote:
> Dave Angel wrote:
>
> > list does not promise better than O(1) behavior
>
> I'm not aware of any list implementations, in any language, that
> promises better than O(1) behavior for any operations. Perhaps there is
> O(j), wh
On 2/6/2014 7:42 PM, MRAB wrote:
On 2014-02-06 23:59, cool-RR wrote:
Hi,
I'm curious. If I append an item to a list from the left using
`list.insert`, will Python always move the entire list one item to
the right (which can be super-slow) or will it check first to see
whether it can
On 2014-02-06 23:59, cool-RR wrote:
Hi,
I'm curious. If I append an item to a list from the left using
`list.insert`, will Python always move the entire list one item to
the right (which can be super-slow) or will it check first to see
whether it can just allocate more memory to the left o
On 2/6/2014 6:59 PM, cool-RR wrote:
Hi,
I'm curious. If I append an item to a list from the left using
`list.insert`, will Python always move the entire list one item to
the right (which can be super-slow) or will it check first to see
whether it can just allocate more memory to the left o
Hi,
I'm curious. If I append an item to a list from the left using `list.insert`,
will Python always move the entire list one item to the right (which can be
super-slow) or will it check first to see whether it can just allocate more
memory to the left of the list and put the item
On Wed, Jul 14, 2010 at 7:54 AM, Eric J. Van der Velden
wrote:
> Hi,
>
> I understand this:
>
>>>> l=[1,2,3]
>>>> l[1:2]=[8,9]
>>>> l
> [1,8,9,3]
>
> But how do you do this with list.insert?
You can't clobber existing items in
On 7/14/2010 7:54 AM Eric J. Van der Velden said...
Hi,
I understand this:
l=[1,2,3]
l[1:2]=[8,9]
l
[1,8,9,3]
But how do you do this with list.insert?
>>> l = [1,2,3,4]
>>> l[1:2]=""
>>> dummy = [l.insert(1,x) for x in reversed([8,9])]
Emi
Hi,
I understand this:
>>> l=[1,2,3]
>>> l[1:2]=[8,9]
>>> l
[1,8,9,3]
But how do you do this with list.insert?
Thanks,
Eric J.
--
http://mail.python.org/mailman/listinfo/python-list
On Aug 29, 5:10 pm, SUBHABRATA <[EMAIL PROTECTED]> wrote:
> Dear group,
> Thanx for your idea to use dictionary instead of a list. Your code is
> more or less, OK, some problems are there, I'll debug them. Well, I
> feel the insert problem is coming because of the Hindi thing.
It's nothing to do w
Dear group,
Thanx for your idea to use dictionary instead of a list. Your code is
more or less, OK, some problems are there, I'll debug them. Well, I
feel the insert problem is coming because of the Hindi thing.
And Python2.5 is supporting Hindi quite fluently.
I am writing in Python2.5.1.
Best Reg
SUBHABRATA, I recommend you study this excellent response carefully.
castironpi wrote:
On Aug 28, 11:13 am, SUBHABRATA <[EMAIL PROTECTED]> wrote:
-.
Instead split up your inputs first thing.
trans= { 'a': 'A', 'at': 'AT', 'to': 'TO' }
sample= 'a boy at the park walked to the tree'
expected= '
On Aug 28, 11:13 am, SUBHABRATA <[EMAIL PROTECTED]> wrote:
> Dear Group,
> I wrote one program,
> There is a dictionary.
> There is an input string.
> Every word of input string the word is matched against the dictionary
> If the word of input string is matched against the dictionary it gives
> the
Subhabrata, it's very difficult for me to understand what your short
program has to do, or what you say. I think that formatting and code
style are important.
So I suggest you to give meaningful names to all your variable names,
to remove unused variables (like n), to add blank likes here and ther
Diez B. Roggisch schrieb:
SUBHABRATA schrieb:
Some people in the room told I am kidding, but I learnt Python from
Python docs which gives examples like these,
But I write explicit comments,
an excerpt from python docs:
# Measure some strings:
... a = ['cat', 'window', 'defenestrate']
for x in a
SUBHABRATA schrieb:
Some people in the room told I am kidding, but I learnt Python from
Python docs which gives examples like these,
But I write explicit comments,
an excerpt from python docs:
# Measure some strings:
... a = ['cat', 'window', 'defenestrate']
for x in a:
... print x, len(x)
Some people in the room told I am kidding, but I learnt Python from
Python docs which gives examples like these,
But I write explicit comments,
an excerpt from python docs:
# Measure some strings:
... a = ['cat', 'window', 'defenestrate']
>>> for x in a:
... print x, len(x)
...
cat 3
window 6
d
On Thu, 28 Aug 2008 09:13:00 -0700, SUBHABRATA wrote:
> import re
> def wordchecker1(n):
> # INPUTTING STRING
> a1=raw_input("PRINT ONE ENGLISH SENTENCE FOR DICTIONARY CHECK:")
> #CONVERTING TO LOWER CASE
> a2=a1.lower()
> #CONVERTING INTO LIST
> a3=a2.split()
> #DICTIO
Dear Group,
I wrote one program,
There is a dictionary.
There is an input string.
Every word of input string the word is matched against the dictionary
If the word of input string is matched against the dictionary it gives
the word of the dictionary.
But if it does not find it gives the original wo
31 matches
Mail list logo