In <9b80c233-ad31-44c8-8a6e-9002ab11b...@googlegroups.com> Nir 
<nircher...@gmail.com> writes:

> >>> k = ['hi','boss']
> >>>
> >>> k
> ['hi', 'boss']
> >>> 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'] ?

> This isn't a big deal, but I am just curious as to why it does this.

Because you typed 'str.upper' instead of 'str.upper()'.

-- 
John Gordon         Imagine what it must be like for a real medical doctor to
gor...@panix.com    watch 'House', or a real serial killer to watch 'Dexter'.

-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to