For Loop Dilema [python-list]

arya.kumar2494 at gmail.com arya.kumar2494 at gmail.com
Mon Feb 26 13:27:42 EST 2018


On Monday, February 26, 2018 at 12:57:25 PM UTC+5:30, Chris Angelico wrote:
> On Mon, Feb 26, 2018 at 5:19 AM,  <arya.kumar2494 at gmail.com> wrote:
> > Why we don’t use:
> >
> > for _ in _ in _
> >
> > Instead of
> >
> > for _ in _:
> >         for _ in _:
> >
> > Ex:
> >
> > Names = ["Arya","Pupun"]
> >
> > for name in Names:
> >    for c in name:
> >        print(c)
> >
> > instead use:
> >
> > for c in name in Names:
> >         print(c)
> 
> Because programming is all about building up a program from
> primitives. The number of times when we need this kind of nested loop
> (with absolutely nothing in between the loops) is way too small to
> justify dedicated syntax.
> 
> ChrisA

Thank you.



More information about the Python-list mailing list