title: How to define a boolean parameter in Python
body: <p>I have defined a function that would print a specific string depending on its value. However, I get an error message saying that <code>global name 'must_print' is not defined</code>.</p>
  
  <p>This is the code I have:</p>
  
  <pre><code>def myfunction(must_print):
      must_print = True
      if bool(must_print) == True:
          print("Done")
      elif bool(must_print) == False:
          print("Change value")
  
  if __name__ == "__main__":
      myfunction(must_print)
  </code></pre>
  
  <p>Do you know why I'm getting this error? </p>