with a cell class like this:
#!/usr/bin/python
import sys
class Cell:
def __init__( self, data, next=None ):
self.data = data
self.next = next
def __str__( self ):
return str( self.data )
def echo( self ):
print self.__str__()
--
http://mail.python.org/mailman/listinfo/python-l
list in Python.
"Gary Herron" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Dongsheng Ruan wrote:
>> with a cell class like this:
>>
>> #!/usr/bin/python
>>
>> import sys
>>
>> class Cell:
>>
>> def
Hi
Does anybody know how to pass multiple arguments to the function
tested in timeit.timer() in
python?
I googled and found how to pass one argument:
x=1
mytime = timeit.Timer( setup="from Createlst import createlst", stmt=
"createlst(%s)"%(x) )
But how can I extend it to two or more
I remember that in python there is some kind of dummy statement that just
holds space and does nothing.
I want it to hold the place after a something like if a>b: do nothing
I can't just leave the space blank after if statement because there will be
error message.
Does anybody know what to ins
Yes, that's just what I want.
Thanks!
- Original Message -
From: Analog Kid
To: Dongsheng Ruan
Cc: python-list@python.org
Sent: Wednesday, January 31, 2007 12:04 PM
Subject: Re: What is the dummy statement that do nothing in Python?
hey dongsheng:
not too sure
Not quite related with Python. But my Data Structure course is experiemented
on python and there is no data structure group, So I have to post here:
Write a procedure (in pseudocode!) to increase the number of buckets in a
(closed) hash table. Analyze its time and space complexity.
--
http:/
You mentioned "it doubles in size".
Are you saying that a new double sized array is allocated and the contents
of the old list is copied there?
Then the old list is freed from memory?
It seems to be what is called amortized constant.
Say the list size is 100, before it is fully used, the append
This seems to be clever to use reference for list.
Is it unique to Python?
How about the traditional programming languages like C, Pascal or C++?
"Roel Schroeven" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Dongsheng Ruan schreef:
>> "Roe
I got feed back saying" list object is not callable". But I can't figure out
what is wrong with my code.
A=[3,5,4,9,6,7]
l=len(A)-1
for i in range(l):
print A(i)
--
http://mail.python.org/mailman/listinfo/python-list
I want to turn an Array into a heap, but my code just doesn't work: no
change after execution.
A=[3,5,4,9,6,7]
m=len(A)-1
for i in range(m,1):
t=(i-1)/2
if A[i]>A[t]:
A[i],A[t]=A[t],A[i]
--
http://mail.python.org/mailman/listinfo/python-list
10 matches
Mail list logo