title: Cinema seating plan for python
body: <p>I am creating a seating plan for a movie theater and I am having a problem with adding a seat request after already purchasing one seat. </p>
  
  <p>Here is the code I have been working on </p>
  
  <pre><code>print("Options for Black Panther the movie")
  def display_seats(taken_seats):
      seating = []
      for xd in range(15):
          row = []
          xda = 0
          for xda in range(15):
              row.append("#")
          seating.append(row)
      for x in taken_seats:
          pos = x.split(",")
          seating[(int(pos[0]) - 1)][(int(pos[1]))] = "X"
      dx = 1
      for row in seating:
          if len(str(dx)) &lt; 2:
              de = " " + str(dx)
          else:
              de = dx
          print ("Row: " + str(de) + " ".join(row))
          dx = dx + 1
  def list_options():
      print ("1: View current seating")
      print ("2: view price per row")
      print ("3: View how much you are paying for now")
      print ("4: Buying tickets")
      print ("5: Exit these options")
      new_input = input("Your choice: ")
      return (new_input)
  def purchase_seat(taken_seats):
      print ("Would you like to view current seating availability? ")
      print ("'1' = yes, '2' = no")
      newinput = input("? ")
      if newinput == "1":
          display_seats(taken_seats)
      x = True
      while x == True:
          cost = 0
          print ("what row would you like to buy a seat on? ")
          rowx = input("What row? ")
          print ("What seat would you like to purchase?")
          rowy = input("what seat? ")
          if any((str(rowx) + "," + str(rowy)) for x in taken_seats):
              print ("That seat is already taken, please choose another seat.")
          elif int(rowx) &gt; 15 or int(rowy) &gt; 15:
              print ("Invalid seating location, please choose another seat.")
          else:
              print ("seat purchased.")
              cost = (2 * int(rowx))
              x = False
      return (cost, (str(rowx) + "," + str(rowy)))
  taken_seats = []
  sales = 0
  quitter = 0
  while quitter == 0:
      new_input = list_options()
      if new_input == "5":
          quitter = 1
      elif new_input == "4":
          g = True
          while g == True:
              new_seat = purchase_seat(taken_seats)
              taken_seats.append(new_seat[1])
              print ("That will be: $ " + str(new_seat[0]))
              sales = sales + new_seat[0]
              print ("Would you like to purchase another seat?")
              new_input = input("'1' = yes, '2' = no: ")
              if new_input == "1":
                  pass
              else:
                  g = False
      elif new_input == "3":
          print ("Total sales: $" + str(sales))
      elif new_input == "2":
          xd = 0
          while xd &lt; 15:
              print ("Row for the theater " + str(xd + 1) + ": is $" + str((1 + (2 * xd)) + 1))
              xd = xd + 1
      elif new_input == "1":
          display_seats(taken_seats)
      else:
          print ("invalid option.")
  </code></pre>
  
  <p>After choosing option 4 and purchasing a seat and keep answering to input the row you want and the seat when you input another different row and seat coordinates it says "This seat has already been taken"</p>
  
  <p>I have been looking everywhere for an answer and I cant seem to find something. Please help if you can, thanks. </p>