title: where do i incorporate that no body has won, in my tic-tac-toe game
body: <p>I am new to coding and has recently started learning python. My first challenge is to build a tic tac toe game. Below are my codes for the game, everything worked fine except that when there is no winner(i.e. game draw); i want to display <code>no body has won the game.</code> I've tried to incorporate an <code>else</code> in various places. but, they didn't help. Here is my code.</p>
  
  <pre><code>  # a dictionary to display the grid
  grid = {
      '1':'1', '2':'2', '3':'3',
      '4':'4', '5':'5', '6':'6',
      '7':'7', '8':'8', '9':'9'
  }
  # a list to store the values that has already been entered
  used_places = []
  
  # players and their symbols
  player_1 = 'x'
  player_2 = 'o'
  
  # to store result
  result = None
  
  def grid_display():
      #this function displays the grid
      print('\n\n')
      print(grid['1'], '\t|\t', grid['2'], '\t|\t', grid['3'])
      print(''.rjust(19,'*'))
      print(grid['4'], '\t|\t', grid['5'], '\t|\t', grid['6'])
      print(''.rjust(19, '*'))
      print(grid['7'], '\t|\t', grid['8'], '\t|\t', grid['9'])
  
  def win_the_game():
      # this function checks for result and returns true or false
      if(
          (grid['1'] == grid['2'] == grid['3']) or (grid['4'] == grid['5'] == grid['6']) or
          (grid['7'] == grid['8'] == grid['9']) or (grid['1'] == grid['4'] == grid['7']) or
          (grid['2'] == grid['5'] == grid['8']) or (grid['3'] == grid['6'] == grid['9']) or
          (grid['1'] == grid['5'] == grid['9']) or (grid['3'] == grid['5'] == grid['7'])
      ):
          return True
      else:
          return False
  
  def taking_turns(turn):
      #this function asks user for input
      print("its turn of ", turn)
      choice = input("enter your choice")
      while not (choice.isdecimal() and choice in grid and (choice not in used_places)):
      # taking proper input by checkin it with already entered numbers
      # and if it is a number
      # and if number is in between 1 and 9
          choice = input("\nenter your choice properly:")
  
      player_move(choice, turn)
  
  def player_move(move, assign):
      # this function fills the entered numbers into used_places list
      # and replaces numbers in grid with user input
      used_places.append(move)
      grid[move] = assign
  
  print("player 1 : 'X'")
  print("player 2 : 'O'")
  
  for i in range(0,10):               # loops 9 times to play the game
      if i % 2 == 0:                  # giving turns. if i is even, player 1 gets turn and odd, player 2
          grid_display()              # displaying complete grid
          turn = player_1             # to display whose turn it is; refer the function
          taking_turns(turn)
          if win_the_game() == True:  # if the called function returns true in this 'if'
              result = turn           # player 1 wins
              break
      else:
          grid_display()              # same code as above
          turn = player_2
          taking_turns(turn)
  
          if win_the_game() == True:
              result = turn
              break
  
  print('\n\n',result, "won the game!!")     # printing result
  </code></pre>