Sorry. That was  stupid of me. The loop does nothing.



regards,
Sarma.

On Mon, Apr 3, 2017 at 8:44 PM, Alan Gauld via Tutor <tutor@python.org>
wrote:

> On 03/04/17 16:07, D.V.N.Sarma డి.వి.ఎన్.శర్మ wrote:
> > Modifying the code as shown below may work.
>
> I doubt it.
>
> > with open(file_path) as a:
> >     b = a.read()
> >
> > get_year = input("What year were you born? ")
> >
> > count = 0
> > for year in b:
>
> Once more I ask, what does this loop do?
>
> >     if get_year in b:
> >         count += 1
> > print("Your birth date occurs %s times in PI!" % (count))
>
> --
> Alan G
> Author of the Learn to Program web site
> http://www.alan-g.me.uk/
> http://www.amazon.com/author/alan_gauld
> Follow my photo-blog on Flickr at:
> http://www.flickr.com/photos/alangauldphotos
>
>
> _______________________________________________
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> https://mail.python.org/mailman/listinfo/tutor
>
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
  • [Tutor] Count... Rafael Knuth
    • Re: [Tut... Alan Gauld via Tutor
      • Re: ... D . V . N . Sarma డి . వి . ఎన్ . శర్మ
        • ... Alan Gauld via Tutor
          • ... D . V . N . Sarma డి . వి . ఎన్ . శర్మ
            • ... Alan Gauld via Tutor
            • ... Alan Gauld via Tutor
              • ... Mats Wichmann
                • ... D . V . N . Sarma డి . వి . ఎన్ . శర్మ
                • ... Alan Gauld via Tutor
                • ... D . V . N . Sarma డి . వి . ఎన్ . శర్మ
                • ... Rafael Knuth
                • ... Alan Gauld via Tutor
                • ... Rafael Knuth
                • ... Alan Gauld via Tutor

Reply via email to