On Sat, 4 Jun 2016 12:50 pm, Christopher Reimer wrote:

>> Nor can you uppercase a string until the string exists:
>>
>> s = "hello world"
>> s = s.uppercase()
> 
>  >>> s = "hello world".upper()
>  >>> print(s)
> HELLO WORLD


"hello world" creates a string. Then you call .upper() on that string.

Perhaps a better example (demonstrating the impossibility) would be:

s = .upper()

but I thought that would not be clear.


> This works in Python 3. Not sure if s.uppercase() was meant as an
> example for a different language.

Nope, just not the clearest example.



-- 
Steven

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

Reply via email to