title: Python 3 Exception: TypeError: function missing 1 required positional argument: 'words'
body: <p>My function needs one argument words, but i want the program not to crash if no argument.</p>
  
  <pre><code>def get_count(words):
      try:
          consonants_str = "bcdfghjklmnpqrstvwxyzBCDFGHJKLMNPQRSTVWXYZ"
          vowels_str = "aeiouAEIOU"
          consonants_ls = []
          vowels_ls = []
          words_ls = []
          result = {"vowels": 0, "consonants": 0}`
  
          for element in consonants_str:
              consonants_ls.append(element)
  
          for element in vowels_str:
              vowels_ls.append(element)
  
          if type(words) != type(None):
              for element in words:
                  words_ls.append(element)
  
              for element in words_ls:
                  if element in vowels_ls:
                      result["vowels"] += 1
                  if element in consonants_ls:
                      result["consonants"] += 1
                  else:
                      continue
              else:
                  result["vowels"] = 0
                  result["consonants"] = 0
  
      except TypeError:
          result["vowels"] = 0
          result["consonants"] = 0
  
      answer = {"vowels": result["vowels"],"consonants": result["consonants"]}
  
      return answer`
  </code></pre>
  
  <p>So if I execute the function with </p>
  
  <pre><code>print(get_count())
  </code></pre>
  
  <p>I want, that the program doesn't show me an error like the one in the heading. The exception for that should be in the <code>def</code> of <code>get_count</code> because it should be a closed file. I don't execute in the same file, so the Exception should be independent from other files. </p>
  
  <p>I hope you understand what I mean...</p>
  
  <p>Thanks for your answers!
  NoAbL</p>