[Tutor] extracting numbers from a list

Asrarahmed Kadri ajkadri at googlemail.com
Tue Oct 17 03:08:59 CEST 2006


I agree.
Regards,

Asrar


On 10/17/06, Kent Johnson <kent37 at tds.net> wrote:
>
> Asrarahmed Kadri wrote:
> > My solution : (i have tested it)
> >
> >
> > list1 = [10,15,18,20,25,30,40]
> >
> > for i in range(len(list1)-1):
> >     print list1[i],list1[i+1]
> >     list1[i+1] += 1
>
> Note that this changes the original list, which may or may not be
> acceptable. Normally you would expect a printing function not to change
> the value being printed.
>
> Kent
>
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
>



-- 
To HIM you shall return.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20061017/23936edf/attachment.htm 


More information about the Tutor mailing list