Re: [Tutor] indexing elements

2007-09-04 Thread Alan Gauld
"chinni" <[EMAIL PROTECTED]> wrote > > i had some doubt about this line can any body clarify this > plz... > endings = ['st', 'nd', 'rd'] + 17 * ['th'] + ['st', 'nd', 'rd'] + 7 > * ['th'] > + ['st'] Using the interpreter: >>> endings = ['st', 'nd', 'rd'] + 17 * ['th'] + ['st', 'nd', 'rd']

Re: [Tutor] indexing elements

2007-09-03 Thread Ian Witham
Hi, I'm not too sure what your asking here, your code assigns the following to endings: ['st', 'nd', 'rd', 'th', 'th', 'th', 'th', 'th', 'th', 'th', 'th', 'th', 'th', 'th', 'th', 'th', 'th', 'th', 'th', 'th', 'st', 'nd', 'rd', 'th', 'th', 'th', 'th', 'th', 'th', 'th', 'st'] This is what we would

Re: [Tutor] indexing elements

2007-09-03 Thread Kent Johnson
chinni wrote: > Hi all, > > i had some doubt about this line can any body clarify this plz... > endings = ['st', 'nd', 'rd'] + 17 * ['th'] + ['st', 'nd', 'rd'] + 7 * > ['th'] + ['st'] You can try it in the interactive interpreter: In [8]: endings = ['st', 'nd', 'rd'] + 17 * ['th'] + ['st',