title: Python error 'object string has no function'
body: <p>As a relatively new programmer, I decided to make a small text adventure as my first project. It works fine, except when you try to go north. I am getting the error posting above. I believe it has to do with the variable location, but I'm not sure.    </p>
  
  <pre><code>import random
  import os
  import time
  os.system('cls')
  yes = ("Yes", "yes", "y", "Y", "Yeah", "yeah", "yea", "Yea", "m8")
  no = ("No", "no", "n", "N", "naw", "Naw", "Nope", "nope")
  inventory = ("inv", "inventory", "i", "inven", "Inventory")
  eats = ("eat","e", "Eat")
  statss = ("stats", "s", "statistics", "Stats")
  attack = ("attack", "combat", "a", "c", "fight", "Attack", "Combat", "Fight")
  use = ("use", "u", "Use")
  northh = ("Go North", "go north", "north", "North", "N", "n")
  food = ("Bread")
  items = ("Lantern")
  weapons = ("Dagger")
  hunger = 0
  gold = 0
  hp = 0 
  inv = []
  class Room:
      def __init__(self, name, desc, items, north):
          self.name = name
          self.desc = desc
          self.items = items
          self.north = north
  CaveEntrance = Room("CaveEntrance", "The entrance to a large cave.", "Lantern", "None")
  Beach = Room("Beach", "The beach. The sand is warm and the water is inviting.", "Lantern", "CaveEntrance")
  inv.append ("Bread")
  print("Hello, adventurer. What is your name?")
  name = input("&gt; ") 
  print("Hello,",name,".",)
  print("You have just begun a grand adventure. Prepare yourself now.")
  def gen():
      global hp
      global gold      
      global hunger
      hp = random.randint(10, 25)
      gold = random.randint(0, 200)
      hunger = random.randint(10, 50)
      print("You start your journey with", hp, "hit points and", gold, "gold. You also have",hunger,"food.")
      print("Is this correct?")
      print("Y/N")
      ans = input("&gt; ")
      if ans in yes:
          print("We will now continue") 
      if ans in no:
          print("Let's try again.")   
          gen()
  gen()
  print("STORY:")
  print("You are going on vacation to the beach with your parents. You play in the waves for some time before noticing something off in the distance. Your curiosity is piqued. ")
  location = Beach
  def eat():
      global hunger
      print(*inv,sep='\n')
      print("Eat which item?")
      eatitem = input("&gt; ")
      if eatitem in food and eatitem in inv:
          hunger = hunger + 5
          inv.remove(eatitem)
          print("Yum.")
          cmd()     
      elif eatitem not in inv:
          print("You don't have",eatitem,".")
          cmd()
      elif eatitem not in food:
          print("You can't eat that!")
          cmd()
  def north():
      global location
      print("Heading north towards", location.north,"...") 
      time.sleep(2)
      location = location.north
      cmd()
  def stats():
      global hp
      global hunger
      global gold
      print("HitPoints:",hp)
      print("Food:",hunger)
      print("Gold:",gold)
      cmd ()
  def cmd():
      global location
      global hunger
      print()
      print(location.name)
      print()
      print(location.desc)
      print()
      hunger = hunger - 1
      urcmd = input("&gt; ")
      if urcmd in northh:
          north()
      elif urcmd in inventory:
          if not inv:
              print("Inventory empty.")
          else:
              print(*inv,sep='\n')
          cmd()
      elif urcmd in eats:
          eat()
      elif urcmd in statss:
          stats()
      elif urcmd in attack:
          combat()
      elif urcmd in use:
          use()
      elif urcmd == ("exit"):
          print("Are you sure you want to quit?")
          print()
          print("All progress will be lost!")
          print()
          print("Y/N")
          ans = input("&gt; ")
          if ans in yes:
              print("Ok, exiting...")
              exit()
          else:
              print("Ok, returning to game.")
              cmd()
      else:
          print("That is not a command. For a list of commands, type help.")
          cmd()
  cmd()
  </code></pre>