[Tutor] skip/slice more than every second?
Sebastian Cheung
sebastian_cheung at yahoo.com
Tue Sep 29 05:33:24 CEST 2015
print range(1,15,4)
ans: [1, 5, 9,13]
Sent from my iPhone
> On 29 Sep 2015, at 04:16, questions anon <questions.anon at gmail.com> wrote:
>
> a = [1,2,3,4,5,6,7,8,9,10,11,12,13,14]
>
> how can I show the first then skip three and show the next and so on?
> For example:
> show 1
> then skip 2,3,4
> then show 5
> then skip 6,7,8
> then show 9
> then skip 10,11,12,
>
> etc.
>
> Any feedback will be greatly appreciated.
> _______________________________________________
> Tutor maillist - Tutor at python.org
> To unsubscribe or change subscription options:
> https://mail.python.org/mailman/listinfo/tutor
More information about the Tutor
mailing list