What are the parentheses for at the end of Python method names?
问题 I'm a beginner to Python and programming in general. Right now, I'm having trouble understanding the function of empty parentheses at the end of method names, built-in or user-created. For example, if I write: print "This string will now be uppercase".upper() ...why is there an empty pair of parentheses after "upper?" Does it do anything? Is there a situation in which one would put something in there? Thanks! 回答1: the parentheses indicate that you want to call the method upper() returns the