Thx Alex.
--
* Posted with NewsLeecher v3.0 Beta 7
* http://www.newsleecher.com/?usenet
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
> Thanks Guys, Wow, i didnt knew that there was alist reverse function.
> thx. also. i need a good documentation of the os and sys modules as
> well as builtin functions of python.
>
> the standard python documentation doesnt work for me. can u recommend
> something?
I
Thanks Guys, Wow, i didnt knew that there was alist reverse function.
thx. also. i need a good documentation of the os and sys modules as
well as builtin functions of python.
the standard python documentation doesnt work for me. can u recommend
something?
--
* Posted with NewsLeecher v3.0 Beta
[EMAIL PROTECTED] wrote:
> i m trying to reverse the order in which the
> strings are stored in list
>
> then pop it into another list
>
> what m i doin worng??
>
> here's the code:
>
> list1 = []
> list2 = []
> list1.extend('123456789')
How about this instead (Python 2.4 or later):
list2 = l
...
list2=list1[:]
...
Yes, naturally, where was my head ?-))
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] writes:
> If what you want is a reversed copy, you could just append list1
> elements to list2, and use the reverse function such as
...
for i in list1:
> ... list2.append(i)
> ...
Don't do this by ahnd - let python do it for you:
list2 = list(list1)
or
list2 = lis
[EMAIL PROTECTED] wrote:
> If what you want is a reversed copy, you could just append list1
> elements to list2, and use the reverse function such as
> >>> ...
> >>> for i in list1:
> ... list2.append(i)
> ...
> >>> list2.reverse()
> >>> list1
> ['1', '2', '3', '4', '5', '6', '7', '8', '9']
> >>>
Here is an example of copying then reversing a list:
>>> l1 = [1,2,"C"]
>>> l2 = l1[:]
>>> l2.reverse()
>>> l2
['C', 2, 1]
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
> i m trying to reverse the order in which the
> strings are stored in list
>
> then pop it into another list
>
> what m i doin worng??
>
> here's the code:
>
> list1 = []
> list2 = []
> list1.extend('123456789')
>
> print list1
>
> for a in list1:
> list2 = list1.pop(
i m trying to reverse the order in which the
strings are stored in list
then pop it into another list
what m i doin worng??
here's the code:
list1 = []
list2 = []
list1.extend('123456789')
print list1
for a in list1:
list2 = list1.pop()
print list2
--
* Posted with NewsLeecher v3.0 Bet
10 matches
Mail list logo