learnpython.org - an online interactive Python tutorial

flebber flebber.crue at gmail.com
Sat Apr 23 08:49:51 EDT 2011


On Apr 23, 4:28 pm, Dennis Lee Bieber <wlfr... at ix.netcom.com> wrote:
> On Fri, 22 Apr 2011 17:08:53 +1000, Chris Angelico <ros... at gmail.com>
> declaimed the following in gmane.comp.python.general:
>
> > I'm not so sure that all strings should autopromote to integer (or
> > "numeric" generally). However, adding a string and a number _should_
> > (IMHO) promote the number to string.
>
> > print "Hello, "+name+", you have "+credit+" dollars of credit with us."
>
> > Okay, that one is probably better done with the % operator, but it
> > definitely makes logical sense to concatenate numbers and strings as
> > strings, not to add them as numbers.
>
>         But what if /I/ want
>                 "A" + 1
> to return
>                 "B"
>
> <G>
> --
>         Wulfraed                 Dennis Lee Bieber         AF6VN
>         wlfr... at ix.netcom.com    HTTP://wlfraed.home.netcom.com/

I like what you have done. Was it deliberate that your site teaches
python 2.x code rather than 3.x?



More information about the Python-list mailing list