Re: struggling with these problems

2013-01-29 Thread Steven D'Aprano
On Wed, 30 Jan 2013 03:59:32 +, MRAB wrote: > Python uses half-open ranges (and counts from 0), which means that the > start index is included and the end index is excluded. > > Therefore, worst_offenders[5:6] means the slice from index 5 up to, but > excluding, index 6; in other words, an em

Re: struggling with these problems

2013-01-29 Thread MRAB
On 2013-01-30 03:26, su29090 wrote: 1.Given that worst_offenders has been defined as a list with at least 6 elements, write a statement that defines lesser_offenders to be a new list that contains all the elements from index 5 of worst_offenders and beyond. Do not modify worst_offenders .

struggling with these problems

2013-01-29 Thread su29090
1.Given that worst_offenders has been defined as a list with at least 6 elements, write a statement that defines lesser_offenders to be a new list that contains all the elements from index 5 of worst_offenders and beyond. Do not modify worst_offenders . I tried this but it didn't work: le