title: Tkinter : trying to return value from a button
body: <p>I have no idea of how to solve my problem i have a code that looks like this:</p>
  
  <pre><code>def f(x):
      x=x.get()
      y=x**2
      z=x-1
  
  Mylist=[]
  x=Entry(master)
  cmd=lambda x=x : f(x)
  Button(master, text="Ok", command=cmd).pack()
  </code></pre>
  
  <p>What i want to do is something like</p>
  
  <pre><code>Mylist.append([y,z])
  </code></pre>
  
  <p>In order to use my results somewhere else in my program</p>
  
  <p>Also i know that i could use a class but teachers don't want us to use class for that project...</p>
  
  <p>Do you have any idea ?</p>