Python newbie
kaer
kaerbuhez at gmail.com
Fri Sep 19 05:00:20 EDT 2008
On 19 sep, 10:13, Steven D'Aprano
<ste... at REMOVE.THIS.cybersource.com.au> wrote:
> On Fri, 19 Sep 2008 09:13:48 +0200, Mladen Gogala wrote:
> > I am a Python newbie who decided to see what that Python fuss is all
> > about. Quite frankly, I am a bit perplexed., here is what perplexes me:
> > perl -e '@a=(1,2,3); map { $_*=2 } @a; map { print "$_\n"; } @a;'
>
> Naturally you will be perplexed if you assume that Python is just Perl
> with a more verbose syntax. It isn't.
>
Indeed, it isn't ... at all:
$ python -c 'for s in [2*x for x in (1, 2, 3)]: print s'
2
4
6
And it's always (a lot) more readable :-)
kb
More information about the Python-list
mailing list