Hi,
This is my first post.I found interesting thing while playing with lists.
l = ['asd',"asd'das",'qw','213']
print "original list:", l
print "first item:", l.pop(0)
print "second item:", l.pop(1)
print "modified list:", l
output:
original list:
first item: asd
second item: qw
modified list: ["asd'das", '213']
Why is it deleting third item,why not second one?
What I think is beacuse of single quote enclosed within double quotes and pop() function failed to handle this.But pop() doesn't show any error, instead it deletes third item..!
l.remove("asd'das")
remove() function removes second item properly.
What may be the reason for this kind of behavoiur. Any idea?
BYW, I am using python2.7.