[Tutor] Occurrence of number 2 in a range from 1 to 100

Reuben reuben.dlink at gmail.com
Sun Dec 1 10:27:33 CET 2013


I mean occurrence of 2 from numbers 1 to 100.  The number could be the
first digit or second digit in a two digit number..for e.g. In number 21 it
appears as first digit. For number 92 it appears as second digit
On 01-Dec-2013 2:45 PM, "Steven D'Aprano" <steve at pearwood.info> wrote:

> On Sun, Dec 01, 2013 at 11:20:02AM +0530, Reuben wrote:
> > Hi,
> >
> > How can we write a logic for detecting the number 2 in  range from 1 to
> 100
>
> 2 in range(1, 101)
>
>
> --
> Steven
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> To unsubscribe or change subscription options:
> https://mail.python.org/mailman/listinfo/tutor
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20131201/a1e28ddb/attachment.html>


More information about the Tutor mailing list