working with methods methods are simply another kind of function that reside in classes you create and work with methods in precisely the same way that you do functionsexcept that methods are always associated with class (you don' see freestanding methods as you do functionsyou can create two kinds of methodsthose associated with the class itself and those associated with an instance of class it' important to differentiate between the two the following sections provide the details needed to work with both creating class methods class method is one that you execute directly from the class without creating an instance of the class sometimes you need to create methods that execute from the classsuch as the functions you used with the str class in order to modify strings as an examplethe multipleexception py example in uses the str upper(function the following steps demonstrate how to create and use class method open python shell window you see the familiar python prompt type the following code (pressing enter after each line and pressing enter twice after the last line)class myclassdef sayhello()print("hello there!"the example class contains single defined attributesayhello(this method doesn' accept any arguments and doesn' return any values it simply prints message as output howeverthe method works just fine for demonstration purposes type myclass sayhello(and press enter the example outputs the expected stringas shown in figure - notice that you didn' need to create an instance of the class -the method is available immediately for use close the python shell window