Hello list,
When it comes to printing things while some computation is being done, there
are 2 extremes.
1. printing speed is slower than data-to-print generation speed. In this case,
printing is a bottleneck. Examples: "for i in xrange(2**30): print i". Without
the print, this code would be m
Has it been considered to add shell features to python, such that it can be
used as a default shell, as a replacement for bash, etc.
I'm sure everyone would agree that doing this would make the terminal very
powerful.
What are your views on this?
--
http://mail.python.org/mailman/listinfo/pyth
Well, if not modify python itself, I was thinking of making another shell,
which borrows a lot from python, something like merging bash and python. such
that I can do `cd ~/Desktop/dev` and `for i in open('file.txt'): print i` at
the some shell. This I think would be VERY useful.
IPyhton is ver
Well, if not modify python itself, I was thinking of making another shell,
which borrows a lot from python, something like merging bash and python. such
that I can do `cd ~/Desktop/dev` and `for i in open('file.txt'): print i` at
the some shell. This I think would be VERY useful.
IPyhton is ver
def adder():
s = 0
def a(x):
s += x
return sum
return a
pos, neg = adder(), adder()
for i in range(10):
print pos(i), neg(-2*i)
This should work, right? Why does it not?
Checkout slide no. 37 of a Tour of Go to know inspiration. Just wanted
I want a list which contains n lists, which are all different. I had
read a page which was about the mutability of lists, and how the *
operator on lists just does a shallow copy. But I can't find it now.
Does anyone know of that page ?
Either way, How to get a list of list, with all original list
Thanks. This works. :)
Regards,
Sherjil Ozair
--
http://mail.python.org/mailman/listinfo/python-list
There are basically two ways to go about this.
One is, to append the new value, and then sort the list.
Another is to traverse the list, and insert the new value at the
appropriate position.
The second one's complexity is O(N), while the first one's is O(N *
log N).
Still, the second one works mu