title: TypeError : takes 0 positional arguments but 1 was given
body: <p>I have started learning Python. I have created a class which has a function and in that function i have a dictionary . No i am checking whether a key exists in the dictionary or not , after checking i am returning a value from the function . </p>
  
  <p>Now i cam trying to access the function but when when i am doing so i am getting an error <code>"TypeError: first_func() takes 0 positional arguments but 1 was given"</code></p>
  
  <p>Below is the code which i am using :</p>
  
  <pre><code>class myFirst:
      def first_func():
          flag=0
          phonebook = {
              "A" : 938477566,
              "B" : 938377264,
              "C" : 947662781
          }
          # testing code
          if "A" in phonebook:
              flag=1
          if "D" not in phonebook:
              flag = 0
          return flag
  
  myclassObj = myFirst()
  status = myclassObj.first_func()
  
  if status &gt; 1:
      print ("Pass")
  else:
      print ("fail")
  </code></pre>