List rotation
M. Clift
noone at here.com
Wed Sep 29 23:11:47 EDT 2004
Hi All,
Could someone help me out with this?
items = ('a', 'b', 'c', 'd')
items + 1 = ( 'b', 'c', 'd', 'a')
items + 2 = ( 'c', 'd', 'a', 'b')
items + 3 = ( 'd', 'a', 'b', 'c')
trans = 1
list = ('a', 'd', 'b', 'a', 'd', 'c', 'b')
#and items = +1, the list would be;
#list = ('b', 'a', 'c', 'b', 'a', 'd', 'c') etc..
for idx in range(len(list)):
if trans == [1]:
list[idx] = [???]
print l1
Don't laugh, I'm a slow learner : )
Thanks,
M
More information about the Python-list
mailing list