List rotation

M. Clift noone at here.com
Wed Sep 29 23:13:33 EDT 2004


That should of course read print list at the end

"M. Clift" <noone at here.com> wrote in message
news:cjftdv$ofl$1 at news8.svr.pol.co.uk...
> 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