input: Write a function to develop an interactive text-based RPG game in Python that gives the player options to move around in an environment and battle monsters. The function should include a Player class with attributes like health, location, and monsters_killed; a Room class with attributes like name, description, and monsters; and a Monster class with attributes like name and health. The function should also include a start_game function that initiates the game loop, allowing the player to choose actions like moving to a new room or fighting a monster. If the player's health reaches 0, the game should end with a defeat message.
  
  class Player(object):
   def __init__(self):
   self.health = 100
   self.location = 'room one'
   self.monsters_killed = 0
  
  class Room(object):
   def __init__(self):
   self.name = ''
   self.description = ''
   self.monsters = []
  
   def add_monster(self, monster):
   self.monsters.append(monster)
  
  class Monster(object):
   def __init__(self):
   self.name = ''
   self.health = 100
  
   def attack(self, player):
   player.health -= 10
  
  def start_game():
   player = Player()
  
  while True:
   print(f'You are in {player.location}.')
   print('Available actions: move, fight')
   response = input('What would you like to do? ').lower()
  
   if response == 'move':
   if response == 'fight':
   if player.health <= 0:
   print ('You have been defeated!')
   break
  
  if __name__ == '__main__':
   start_game()
  
  assert isinstance(Player().health, int) == True
  assert Player().location == 'room one'
  assert Room().monsters == []
  assert Monster().health == 100
  assert Monster().attack(Player()) == None
output: 
  def start_game():
      player = Player()
      room_one = Room()
      room_one.name = 'room one'
      room_one.description = 'A dark and damp room.'
      room_two = Room()
      room_two.name = 'room two'
      room_two.description = 'A room filled with cobwebs.'
      monster_one = Monster()
      monster_one.name = 'Goblin'
      monster_two = Monster()
      monster_two.name = 'Orc'
      room_one.add_monster(monster_one)
      room_two.add_monster(monster_two)
      rooms = {'room one': room_one, 'room two': room_two}
  
      while True:
          current_room = rooms[player.location]
          print(f'You are in {player.location}. {current_room.description}')
          print('Available actions: move, fight')
          response = input('What would you like to do? ').lower()
  
          if response == 'move':
              if player.location == 'room one':
                  player.location = 'room two'
              else:
                  player.location = 'room one'
          elif response == 'fight':
              if current_room.monsters:
                  monster = current_room.monsters[0]
                  print(f'You are fighting a {monster.name}!')
                  while monster.health > 0 and player.health > 0:
                      monster.attack(player)
                      print(f'{monster.name} attacks you! Your health is now {player.health}.')
                      if player.health <= 0:
                          print('You have been defeated!')
                          return
                      player_attack = input('Press enter to attack the monster: ')
                      if player_attack == '':
                          monster.health -= 20
                          print(f'You attack the {monster.name}! Its health is now {monster.health}.')
                  if monster.health <= 0:
                      print(f'You have defeated the {monster.name}!')
                      current_room.monsters.remove(monster)
                      player.monsters_killed += 1
              else:
                  print('There are no monsters to fight in this room.')
          if player.health <= 0:
              print('You have been defeated!')
              break
  