title: Python Class Attribute Error 'Event' has no attribute
body: <p>I created a code as a collaboration for a game a few friends and I are making for fun, and I am a complete noob at python. I created a class for a battle arena as part of the game:</p>
  
  <pre><code>from tkinter import *
  import random
  
  root = Tk()
  
  
  
  class battle:
  
      def __init__(self, MonHealth):
          self.Distance = 10
          self.Center = 5
          self.MonHealth = MonHealth
      def LEFT1(self):
          if self.Center &lt; 20:
              self.Distance += 1
              distance = abs(self.Distance)
              self.Center += 1
              center = abs(self.Center)
              print (str(distance) + " meters" + "    " + str(center) + " meters")
      def right1(self):
          if self.Center &gt; -20:
              self.Distance -= 1
              self.Center -= 1
              center = abs(self.Center)
              distance = abs(self.Distance)
              print (str(distance) + " meters" + "    " + str(center) + " meters")
      def Lunge1(self):
          hit = [0,1,2,3,4]
          random.shuffle(hit)
          if abs(self.Distance) &lt;= 1 and hit[0] &gt;= 2:
              print ("strike")
              self.MonHealth -= 10
              if self.MonHealth &lt; 0:
                  print ("YOU WIN")
          elif abs(self.Distance) &lt;= 1:
              print ("blocked")
          else:
              print ("miss")
      def block1(self):
          print ("blocked enemy")
  
  
  
  
      root.bind("&lt;Left&gt;", LEFT1)
  
      root.bind("&lt;Right&gt;", right1)
  
      root.bind("&lt;Return&gt;", Lunge1)
  
      root.bind("&lt;Shift_L&gt;", block1)
  </code></pre>
  
  <p>When I run the class, I get the following error:</p>
  
  <blockquote>
    <p>AttributeError: 'Event' object has no attribute 'Center'</p>
  </blockquote>
  
  <p>How do I fix this problem?</p>
  
  <p>I read other explanations and solutions about/for attribute errors, but they were all about 'str' objects. </p>
  
  <p>As a side note, if I delete 'Center' entirely, it gives me the same error for MonHealth. I think I just completely screwed up this code, but is there any way to salvage it? Thanks!</p>