Thanks all, So Python is smarter as I expected. As I am exploring it, I am more excited about it.
On Tue, Apr 2, 2013 at 2:51 PM, <bangpypers-requ...@python.org> wrote: > Send BangPypers mailing list submissions to > bangpypers@python.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://mail.python.org/mailman/listinfo/bangpypers > or, via email, send a message with subject or body 'help' to > bangpypers-requ...@python.org > > You can reach the person managing the list at > bangpypers-ow...@python.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of BangPypers digest..." > > > Today's Topics: > > 1. Beginner Help (Gaurav Malhotra) > 2. Re: Beginner Help (Manish Reddy) > 3. Re: Beginner Help (Venkatraman S) > 4. Re: Beginner Help (L Radhakrishna Rao) > 5. Re: Beginner Help (L Radhakrishna Rao) > 6. Re: Beginner Help (anirudh bhat) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Tue, 2 Apr 2013 14:38:22 +0530 > From: Gaurav Malhotra <gaurav.t...@gmail.com> > To: bangpypers@python.org > Subject: [BangPypers] Beginner Help > Message-ID: > < > caoqbmqweugb+ezfomfzbg49rbjpazlts019tqmoexyrtm58...@mail.gmail.com> > Content-Type: text/plain; charset=ISO-8859-1 > > Hi everyone, > > Below is the code (with output) which can be found in the Python Official > Documentation: > > >>> # Measure some strings: > > ... words = ['cat', 'window', 'defenestrate'] > > >>> for w in words: > > ... print w, len(w) > > ... > > cat 3 > > window 6 > > defenestrate 12 > > # The Problem is: > When "w" is not defined how python interpreter can evaluate the output?? > > Please Explain the lines where "w" is occurred. if i would replace "w" with > any other variable, it will show the same output. > > I want to know "What is happening in the back (i mean how interpreter is > handling it)" ?? > > Thanks & Regards, > Gaurav Malhotra > > -- > *Regards > Gaurav Malhotra > +91-9410562301* > > > ------------------------------ > > Message: 2 > Date: Tue, 2 Apr 2013 14:43:47 +0530 > From: Manish Reddy <manishreddytirum...@gmail.com> > To: Bangalore Python Users Group - India <bangpypers@python.org> > Subject: Re: [BangPypers] Beginner Help > Message-ID: > <CAHhoE0G9ADUYM0jUq8YSgQhPu9zRp+EEUmXs3AX= > x+mgtzc...@mail.gmail.com> > Content-Type: text/plain; charset=ISO-8859-1 > > w is like a variable for python. You can use any variable instead of w and > get the same output. > > Your code is telling python to execute something for each item in the list. > So, w takes 'cat', 'window', 'defenestrate' each time and executes the code > for each of them. > > Hope I helped. > > > On Tue, Apr 2, 2013 at 2:38 PM, Gaurav Malhotra <gaurav.t...@gmail.com > >wrote: > > > Hi everyone, > > > > Below is the code (with output) which can be found in the Python Official > > Documentation: > > > > >>> # Measure some strings: > > > > ... words = ['cat', 'window', 'defenestrate'] > > > > >>> for w in words: > > > > ... print w, len(w) > > > > ... > > > > cat 3 > > > > window 6 > > > > defenestrate 12 > > > > # The Problem is: > > When "w" is not defined how python interpreter can evaluate the output?? > > > > Please Explain the lines where "w" is occurred. if i would replace "w" > with > > any other variable, it will show the same output. > > > > I want to know "What is happening in the back (i mean how interpreter is > > handling it)" ?? > > > > Thanks & Regards, > > Gaurav Malhotra > > > > -- > > *Regards > > Gaurav Malhotra > > +91-9410562301* > > _______________________________________________ > > BangPypers mailing list > > BangPypers@python.org > > http://mail.python.org/mailman/listinfo/bangpypers > > > > > > -- > Manish Reddy > www.LurnQ.com > > > ------------------------------ > > Message: 3 > Date: Tue, 2 Apr 2013 14:44:39 +0530 > From: Venkatraman S <venka...@gmail.com> > To: Bangalore Python Users Group - India <bangpypers@python.org> > Subject: Re: [BangPypers] Beginner Help > Message-ID: > < > can7tdfq92_lrfniaezgtswxba-ulln62dvophnpsyzeccbm...@mail.gmail.com> > Content-Type: text/plain; charset=UTF-8 > > Before someone pops in and says, let me say it.... 'List > Comprehensions'.....ah! now i can RIP :) > > On Tue, Apr 2, 2013 at 2:38 PM, Gaurav Malhotra <gaurav.t...@gmail.com > >wrote: > > > Hi everyone, > > > > Below is the code (with output) which can be found in the Python Official > > Documentation: > > > > >>> # Measure some strings: > > > > ... words = ['cat', 'window', 'defenestrate'] > > > > >>> for w in words: > > > > ... print w, len(w) > > > > ... > > > > cat 3 > > > > window 6 > > > > defenestrate 12 > > > > # The Problem is: > > When "w" is not defined how python interpreter can evaluate the output?? > > > > Please Explain the lines where "w" is occurred. if i would replace "w" > with > > any other variable, it will show the same output. > > > > I want to know "What is happening in the back (i mean how interpreter is > > handling it)" ?? > > > > Thanks & Regards, > > Gaurav Malhotra > > > > -- > > *Regards > > Gaurav Malhotra > > +91-9410562301* > > _______________________________________________ > > BangPypers mailing list > > BangPypers@python.org > > http://mail.python.org/mailman/listinfo/bangpypers > > > > > ------------------------------ > > Message: 4 > Date: Tue, 2 Apr 2013 14:44:57 +0530 > From: L Radhakrishna Rao <satishsaga...@gmail.com> > To: Bangalore Python Users Group - India <bangpypers@python.org> > Subject: Re: [BangPypers] Beginner Help > Message-ID: > < > caazd-jrmwe8prrqrkx-xh-tjf+nhjtaqfwqy8rswcs1msjm...@mail.gmail.com> > Content-Type: text/plain; charset=ISO-8859-1 > > for w in words: > > > > On Tue, Apr 2, 2013 at 2:43 PM, Manish Reddy > <manishreddytirum...@gmail.com>wrote: > > > w is like a variable for python. You can use any variable instead of w > and > > get the same output. > > > > Your code is telling python to execute something for each item in the > list. > > So, w takes 'cat', 'window', 'defenestrate' each time and executes the > code > > for each of them. > > > > Hope I helped. > > > > > > On Tue, Apr 2, 2013 at 2:38 PM, Gaurav Malhotra <gaurav.t...@gmail.com > > >wrote: > > > > > Hi everyone, > > > > > > Below is the code (with output) which can be found in the Python > Official > > > Documentation: > > > > > > >>> # Measure some strings: > > > > > > ... words = ['cat', 'window', 'defenestrate'] > > > > > > >>> for w in words: > > > > > > ... print w, len(w) > > > > > > ... > > > > > > cat 3 > > > > > > window 6 > > > > > > defenestrate 12 > > > > > > # The Problem is: > > > When "w" is not defined how python interpreter can evaluate the > output?? > > > > > > Please Explain the lines where "w" is occurred. if i would replace "w" > > with > > > any other variable, it will show the same output. > > > > > > I want to know "What is happening in the back (i mean how interpreter > is > > > handling it)" ?? > > > > > > Thanks & Regards, > > > Gaurav Malhotra > > > > > > -- > > > *Regards > > > Gaurav Malhotra > > > +91-9410562301* > > > _______________________________________________ > > > BangPypers mailing list > > > BangPypers@python.org > > > http://mail.python.org/mailman/listinfo/bangpypers > > > > > > > > > > > -- > > Manish Reddy > > www.LurnQ.com > > _______________________________________________ > > BangPypers mailing list > > BangPypers@python.org > > http://mail.python.org/mailman/listinfo/bangpypers > > > > > ------------------------------ > > Message: 5 > Date: Tue, 2 Apr 2013 14:46:07 +0530 > From: L Radhakrishna Rao <satishsaga...@gmail.com> > To: Bangalore Python Users Group - India <bangpypers@python.org> > Subject: Re: [BangPypers] Beginner Help > Message-ID: > < > caazd-jtifqzsv4f1uy2p1ksjqgdxt5it25xzq7jx3+j2jnr...@mail.gmail.com> > Content-Type: text/plain; charset=ISO-8859-1 > > for w in words: > print w, len(w) > > this is where w is getting initialized. > > Even if you will use 'i' there, output will be same. > > > On Tue, Apr 2, 2013 at 2:43 PM, Manish Reddy > <manishreddytirum...@gmail.com>wrote: > > > w is like a variable for python. You can use any variable instead of w > and > > get the same output. > > > > Your code is telling python to execute something for each item in the > list. > > So, w takes 'cat', 'window', 'defenestrate' each time and executes the > code > > for each of them. > > > > Hope I helped. > > > > > > On Tue, Apr 2, 2013 at 2:38 PM, Gaurav Malhotra <gaurav.t...@gmail.com > > >wrote: > > > > > Hi everyone, > > > > > > Below is the code (with output) which can be found in the Python > Official > > > Documentation: > > > > > > >>> # Measure some strings: > > > > > > ... words = ['cat', 'window', 'defenestrate'] > > > > > > >>> for w in words: > > > > > > ... print w, len(w) > > > > > > ... > > > > > > cat 3 > > > > > > window 6 > > > > > > defenestrate 12 > > > > > > # The Problem is: > > > When "w" is not defined how python interpreter can evaluate the > output?? > > > > > > Please Explain the lines where "w" is occurred. if i would replace "w" > > with > > > any other variable, it will show the same output. > > > > > > I want to know "What is happening in the back (i mean how interpreter > is > > > handling it)" ?? > > > > > > Thanks & Regards, > > > Gaurav Malhotra > > > > > > -- > > > *Regards > > > Gaurav Malhotra > > > +91-9410562301* > > > _______________________________________________ > > > BangPypers mailing list > > > BangPypers@python.org > > > http://mail.python.org/mailman/listinfo/bangpypers > > > > > > > > > > > -- > > Manish Reddy > > www.LurnQ.com > > _______________________________________________ > > BangPypers mailing list > > BangPypers@python.org > > http://mail.python.org/mailman/listinfo/bangpypers > > > > > ------------------------------ > > Message: 6 > Date: Tue, 2 Apr 2013 14:51:25 +0530 > From: anirudh bhat <abha...@gmail.com> > To: Bangalore Python Users Group - India <bangpypers@python.org> > Subject: Re: [BangPypers] Beginner Help > Message-ID: > < > cahkd0seu3qo7ii2hmgh2ccuea7+gqdzfuqfz3bkem3q+ofs...@mail.gmail.com> > Content-Type: text/plain; charset=ISO-8859-1 > > Hi, > Python is dynamically typed language.You dont initialize variables with > data types as you do it in c. > > > On Tue, Apr 2, 2013 at 2:46 PM, L Radhakrishna Rao > <satishsaga...@gmail.com>wrote: > > > for w in words: > > print w, len(w) > > > > this is where w is getting initialized. > > > > Even if you will use 'i' there, output will be same. > > > > > > On Tue, Apr 2, 2013 at 2:43 PM, Manish Reddy > > <manishreddytirum...@gmail.com>wrote: > > > > > w is like a variable for python. You can use any variable instead of w > > and > > > get the same output. > > > > > > Your code is telling python to execute something for each item in the > > list. > > > So, w takes 'cat', 'window', 'defenestrate' each time and executes the > > code > > > for each of them. > > > > > > Hope I helped. > > > > > > > > > On Tue, Apr 2, 2013 at 2:38 PM, Gaurav Malhotra <gaurav.t...@gmail.com > > > >wrote: > > > > > > > Hi everyone, > > > > > > > > Below is the code (with output) which can be found in the Python > > Official > > > > Documentation: > > > > > > > > >>> # Measure some strings: > > > > > > > > ... words = ['cat', 'window', 'defenestrate'] > > > > > > > > >>> for w in words: > > > > > > > > ... print w, len(w) > > > > > > > > ... > > > > > > > > cat 3 > > > > > > > > window 6 > > > > > > > > defenestrate 12 > > > > > > > > # The Problem is: > > > > When "w" is not defined how python interpreter can evaluate the > > output?? > > > > > > > > Please Explain the lines where "w" is occurred. if i would replace > "w" > > > with > > > > any other variable, it will show the same output. > > > > > > > > I want to know "What is happening in the back (i mean how interpreter > > is > > > > handling it)" ?? > > > > > > > > Thanks & Regards, > > > > Gaurav Malhotra > > > > > > > > -- > > > > *Regards > > > > Gaurav Malhotra > > > > +91-9410562301* > > > > _______________________________________________ > > > > BangPypers mailing list > > > > BangPypers@python.org > > > > http://mail.python.org/mailman/listinfo/bangpypers > > > > > > > > > > > > > > > > -- > > > Manish Reddy > > > www.LurnQ.com > > > _______________________________________________ > > > BangPypers mailing list > > > BangPypers@python.org > > > http://mail.python.org/mailman/listinfo/bangpypers > > > > > _______________________________________________ > > BangPypers mailing list > > BangPypers@python.org > > http://mail.python.org/mailman/listinfo/bangpypers > > > > > ------------------------------ > > Subject: Digest Footer > > _______________________________________________ > BangPypers mailing list > BangPypers@python.org > http://mail.python.org/mailman/listinfo/bangpypers > > > ------------------------------ > > End of BangPypers Digest, Vol 68, Issue 3 > ***************************************** > -- *Regards Gaurav Malhotra +91-9410562301* _______________________________________________ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers