Why is the interpreter is returning a 'reference'?

Marko Rauhamaa marko at pacujo.net
Mon Feb 17 18:09:52 CET 2014


Nir <nirchernia at gmail.com>:

>>>> k= [s.upper for s in k]
>>>> k
> [<built-in method upper of str object at 0x00000000021B2AF8>, <built-in method upper of str object at 0x0000000002283F58>]
>
> Why doesn't the python interpreter just return
> ['HI, 'BOSS'] ?

Try:

   k = [ s.upper() for s in k ]


Marko



More information about the Python-list mailing list