When I type help(\'string\')
in the python interpreter I get information about the string class. There,upper()
is indicated as a function. Yet I can on
There's nothing wrong with what you see.
>>> help('string')
Will show you the string
module documentation. And it looks like there's an upper
function inside:
>>> import string
>>> string.upper('hello')
'hello'
I'd say that this upper
is the same that is called if you do:
>>> 'hello'.upper()
But I'm not sure.
Notice that a string ''
is a str
type not a string
type. This means that you're probably looking for:
>>> help('str')
And here you'll see too the str.upper
method.