title: Methods with the same name in one class in Python
body: <p>How can I declare a few methods with the same name, but with different numbers of parameters or different types in one class?</p>
  <p>What must I change in the following class?</p>
  <pre><code>class MyClass:
      &quot;&quot;&quot;&quot;&quot;&quot;
  
      #----------------------------------------------------------------------
      def __init__(self):
          &quot;&quot;&quot;Constructor&quot;&quot;&quot;
      def my_method(self,parameter_A_that_Must_Be_String):
          print parameter_A_that_Must_Be_String
  
      def my_method(self,parameter_A_that_Must_Be_String,parameter_B_that_Must_Be_String):
          print parameter_A_that_Must_Be_String
          print parameter_B_that_Must_Be_String
  
      def my_method(self,parameter_A_that_Must_Be_String,parameter_A_that_Must_Be_Int):
          print parameter_A_that_Must_Be_String * parameter_A_that_Must_Be_Int
  </code></pre>