title: How to pass a parameter in a lambda function in python?
body: <p>I want to set colors of an object, and don't want to create 10 functions for every color.
  So, I just want to declare the colors and create 10 buttons and one function. Error message is:</p>
  
  <pre><code>&lt;lambda&gt;() missing 1 required positional argument: 'green'
  </code></pre>
  
  <p>The code:</p>
  
  <pre><code>from tkinter import *
  
  green=["#5bd575","#55c76d"]
  #different colors should follow here
  
  root=Tk()
  Btn=Button(text="Trigger lambda", command=lambda green: printfunction(green))
  Btn.pack()
  
  def printfunction(colorset):
      print(colorset)
  </code></pre>
  
  <p>It does not need to be a lambda function, the question is just, How can I call the <code>printfunction</code> with an argument by clicking the button?</p>