Yes, I checked out that I have already run "from string import *". So
the lower() means string.lower() function.

However, something else came out just now:
>>>instr='a'
>>>instr.join('b')
'b'
>>>instr.lower()
'A'
>>>instr
'a'
Both as the method of the type str, join never use the instr instance
object as method parameters while lower do. Compared with the .lower()
method, the instr.join() looks like an independent function, which use
the parameters in the parenthesis and return a value without instr
being changed. So why should it be programmed into the str type?

More confusing things came out to me:
>>>str().lower()
''                                                  #well, this is
understandable.
>>>str.lower(str(),'A')
'a'

How do you explain this result?


Sincerely, thank you so much for help.

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

Reply via email to