List rotation

M. Clift noone at here.com
Thu Sep 30 05:11:47 CEST 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