[Tutor] First real script

Carlos carloslara at web.de
Mon Nov 6 23:10:27 CET 2006


Hi again,

Thanks for your comments they are really appreciated.

Alan, yes you are right, there is no need to use S, A_Len works the same 
way. Beginner mistake

The dictionary way seems to be way better than my idea, will give it a try.

And Danny, your CA is very nice.

Do you know a better way to do this?

            if i < A_Len-1:
               
                a = A_List[i-1]
                b = A_List[i]
                c = A_List[i+1]

            else:

                a = A_List[i-1]
                b = A_List[i]
                c = A_List[0]

if I dont do this I get the following error:

c = A_List[i+1]
IndexError: list index out of range

I have the impression that this can be done in a less clunky way.

Again thanks for your comments.  : )

Best Regards,
Carlos.




More information about the Tutor mailing list