title: Could not convert string to float (Tkinter)
body: <p>I'm trying to build a Minecraft stronghold coordinates finder that uses float variables, here's my code:</p>
  <pre><code>from tkinter import *
  from math import tan
  from math import radians
  def clicked():
      global x1, z1, f1, x2, z2, f2, x, z
      x1=float(x1_string)
      z1=float(z1_string)
      f1=float(f1_string)
      x2=float(x2_string)
      z2=float(z2_string)
      f2=float(f2_string)
      if f1 == 90.0 or f1 == -90.0:
          z = float(z1)
          x = float(tan(radians(-1*f2))*z + x2 - tan(radians(-1*f2)*z2))
      elif f2 == 90.0 or f2 == -90.0:
          z = float(z2)
          x = float(tan(radians(-1*f1))*z + x1 - tan(radians(-1*f1))*z1)
      else:
          z = float((x2 - tan(radians(-1*f2))*z2 - x1 + tan(radians(-1*f1))*z1)/(tan(radians(-1*f1)) - tan(radians(-1*f2))))
          x = float(tan(radians(-1*f1))*z + x1 - tan(radians(-1*f1))*z1)
      x = round(x)
      z = round(z)
      
      
  window = Tk()
  window.title(&quot;Minecraft Stronghold Finder&quot;)
  window.geometry('1280x720')
  text = Label(window, text=&quot;Welcome to the Minecraft Stronghold Finder&quot;, font = ('Arial Bold', 20))
  text.grid(column = 0, row = 0)
  text1 = Label(window, text=&quot;Input your coordinates and angles of view&quot;, font = ('Arial', 15))
  text1.place(x = 0, y = 30)
  text2 = Label(window, text=&quot;First throw:&quot;, font = ('Arial', 15))
  text2.place(x = 0, y = 55)
  text3 = Label(window, text=&quot;Second throw:&quot;, font = ('Arial', 15))
  text3.place(x = 0, y = 105)
  tx1 = Label(window, text=&quot;X:&quot;, font = ('Arial Bold', 15))
  tx1.place(x = 0, y = 80)
  ex1 = Entry(window, width = 10)
  ex1.place(x = 25, y = 85)
  tz1 = Label(window, text=&quot;Z:&quot;, font = ('Arial Bold', 15))
  tz1.place(x = 100, y = 80)
  ez1 = Entry(window, width = 10)
  ez1.place(x = 125, y = 85)
  tang1 = Label(window, text=&quot;Angle:&quot;, font = ('Arial Bold', 15))
  tang1.place(x = 200, y = 80)
  eang1 = Entry(window, width = 10)
  eang1.place(x = 260, y = 85)
  tx2 = Label(window, text=&quot;X:&quot;, font = ('Arial Bold', 15))
  tx2.place(x = 0, y = 130)
  ex2 = Entry(window, width = 10)
  ex2.place(x = 25, y = 135)
  tz2 = Label(window, text=&quot;Z:&quot;, font = ('Arial Bold', 15))
  tz2.place(x = 100, y = 130)
  ez2 = Entry(window, width = 10)
  ez2.place(x = 125, y = 135)
  tang2 = Label(window, text=&quot;Angle:&quot;, font = ('Arial Bold', 15))
  tang2.place(x = 200, y = 130)
  eang2 = Entry(window, width = 10)
  eang2.place(x = 260, y = 135)
  btn = Button(window, text=&quot;Calculate!&quot;, font = ('Arial Bold', 15), command = clicked)
  btn.place(x = 350, y = 95)
  x1_string=format(ex1.get)
  z1_string=format(ez1.get)
  f1_string=format(eang1.get)
  x2_string=format(ex2.get)
  z2_string=format(ez2.get)
  f2_string=format(eang2.get)
      
  textx = Label(window, text=x, font=('Arial Bold', 15))
  textz = Label(window, text=z, font=('Arial Bold', 15))
  textx.place(x = 155, y = 240)
  textz.place(x = 165, y = 240)
  text4 = Label(window, text='X:', font=('Arial Bold', 15))
  text4.place(x = 140, y = 90)
  text5 = Label(window, text='Z:', font=('Arial Bold', 15))
  text5.place(x = 150, y = 90)
  window.mainloop()
  </code></pre>
  <p>Python keeps giving me the following errors one of them is <strong>impossibility of converting string to float</strong>, the other is that <strong>python doesn't see my x and z variables</strong>, but I declared them global:</p>
  <pre><code>Traceback (most recent call last):
  Minecraft Strongholf Finder.py&quot;, line 77, in &lt;module&gt;
      textx = Label(window, text=x, font=('Arial Bold', 15))
  NameError: name 'x' is not defined
  &gt;&gt;&gt; Exception in Tkinter callback
  Traceback (most recent call last):
  Minecraft Strongholf Finder.py&quot;, line 9, in clicked
      x1=float(x1_string)
  ValueError: could not convert string to float: '&lt;bound method Entry.get of &lt;tkinter.Entry object .!entry&gt;&gt;'
  </code></pre>
  <p>I'm new in programming, so please don't judge too harshly. Thank you all :)</p>