Rob Stevenson wrote: > the intention of this snippet is to only print slices where character 1 > is lower case, 2-4 and 6-8 are upper. The logic here looks right to a > VB eye.
> for i in h: > j=s[i:i+8] > if j[0].islower(): > if j[1:3].isupper(): > if j[5:7].isupper(): > print j > > Any help much appreciated! If you want the second character through the fourth (three characters), use j[1:4]. Slices include the first index, not the second - they are 'up to but not including' the end index. Likewise j[5:8] would be the sixth through eigth characters. Kent _______________________________________________ Tutor maillist - [email protected] http://mail.python.org/mailman/listinfo/tutor
