title: why does my pygame war code show up with an error
body: <pre><code>import random
  from time import sleep
  import pygame
  player1=[]
  player2=[]
  x=0
  wind=pygame.display.set_mode((1000,500))
  floor=pygame.Surface((1000,500))
  pygame.display.set_caption("War")
  back=pygame.image.load('back.png')
  acec=pygame.image.load('14c.png')
  qc=pygame.image.load('2c.png')
  wc=pygame.image.load('3c.png')
  ec=pygame.image.load('4c.png')
  rc=pygame.image.load('5c.png')
  tc=pygame.image.load('6c.png')
  yc=pygame.image.load('7c.png')
  uc=pygame.image.load('8c.png')
  ic=pygame.image.load('9c.png')
  oc=pygame.image.load('10c.png')
  jackc=pygame.image.load('11c.png')
  queenc=pygame.image.load('12c.png')
  kingc=pygame.image.load('13c.png')
  aced=pygame.image.load('14d.png')
  qd=pygame.image.load('2d.png')
  wd=pygame.image.load('3d.png')
  ed=pygame.image.load('4d.png')
  rd=pygame.image.load('5d.png')
  td=pygame.image.load('6d.png')
  yd=pygame.image.load('7d.png')
  ud=pygame.image.load('8d.png')
  pd=pygame.image.load('9d.png')
  od=pygame.image.load('10d.png')
  jackd=pygame.image.load('11d.png')
  queend=pygame.image.load('12d.png')
  kingd=pygame.image.load('13d.png')
  aceh=pygame.image.load('14h.png')
  qh=pygame.image.load('2h.png')
  wh=pygame.image.load('3h.png')
  eh=pygame.image.load('4h.png')
  rh=pygame.image.load('5h.png')
  th=pygame.image.load('6h.png')
  yh=pygame.image.load('7h.png')
  uh=pygame.image.load('8h.png')
  ih=pygame.image.load('9h.png')
  oh=pygame.image.load('10h.png')
  jackh=pygame.image.load('11h.png')
  queenh=pygame.image.load('12h.png')
  kingh=pygame.image.load('13h.png')
  aces=pygame.image.load('14s.png')
  qs=pygame.image.load('2s.png')
  ws=pygame.image.load('3s.png')
  es=pygame.image.load('4s.png')
  rs=pygame.image.load('5s.png')
  ts=pygame.image.load('6s.png')
  ys=pygame.image.load('7s.png')
  us=pygame.image.load('8s.png')
  ps=pygame.image.load('9s.png')
  os=pygame.image.load('10s.png')
  jacks=pygame.image.load('11s.png')
  queens=pygame.image.load('12s.png')
  kings=pygame.image.load('13s.png')
  acesc=[14,acec,"c"]
  twoc=[2,qc,"c"]
  threec=[3,wc,"c"]
  fourc=[4,ec,"c"]
  fivec=[5,rc,"c"]
  sixc=[6,tc,"c"]
  sevenc=[7,yc,"c"]
  eightc=[8,uc,"c"]
  ninec=[9,ic,"c"]
  tenc=[10,oc,"c"]
  jacksc=[11,jackc,"c"]
  queensc=[12,queenc,"c"]
  kingsc=[13,kingc,"c"]
  acesd=[14,aced,"d"]
  twod=[2,qd,"d"]
  threed=[3,wd,"d"]
  fourd=[4,ed,"d"]
  fived=[5,rd,"d"]
  sixd=[6,td,"d"]
  sevend=[7,yd,"d"]
  eightd=[8,ud,"d"]
  nined=[9,pd,"d"]
  tend=[10,od,"d"]
  jacksd=[11,jackd,"d"]
  queensd=[12,queend,"d"]
  kingsd=[13,kingd,"d"]
  acesh=[14,aceh,"h"]
  twoh=[2,qh,"h"]
  threeh=[3,wh,"h"]
  fourh=[4,eh,"h"]
  fiveh=[5,rh,"h"]
  sixh=[6,th,"h"]
  sevenh=[7,yh,"h"]
  eighth=[8,uh,"h"]
  nineh=[9,ih,"h"]
  tenh=[10,oh,"h"]
  jacksh=[11,jackc,"h"]
  queensh=[12,queenc,"h"]
  kingsh=[13,kingc,"h"]
  acess=[14,aces,"s"]
  twos=[2,qs,"s"]
  threes=[3,ws,"s"]
  fours=[4,es,"s"]
  fives=[5,rs,"s"]
  sixs=[6,ts,"s"]
  sevens=[7,ys,"s"]
  eights=[8,us,"s"]
  nines=[9,ps,"s"]
  tens=[10,os,"s"]
  jackss=[11,jacks,"s"]
  queenss=[12,queens,"s"]
  kingss=[13,kings,"s"]
  y=0
  deck=[acesc,acess,acesh,acesd,twod,twos,twoh,twoc,threed,threes,threeh,threec,fours,fourd,fourh,fourc,fives,fived,fiveh,fivec,sixs,sixd,sixh,sixc,sevens,sevend,sevenh,sevenc,eights,eightd,eighth,eightc,nines,nined,nineh,ninec,tens,tend,tenh,tenc,jacks,jackd,jackh,jackc,queens,queend,queenh,queenc,kings,kingd,kingh,kingc]
  win=False
  #shuffle
  while y&lt;4:
      y+=1
      random.shuffle(deck)
  #deal
  pygame.init()
  while x&lt;52:
      player1.append(deck[x])
      x+=1
      player2.append(deck[x])
      x+=1
  while win==False:
      keys=pygame.key.get_pressed()
      wind.fill((35,110,43))
      for event in pygame.event.get():
          if event.type==pygame.QUIT:
              win=True
  #draw next card
      if keys[pygame.K_SPACE]:
  #comparison of card values and changing of hands
  #show cards
          wind.blit(player1[0][1],(426,260))
          wind.blit(player2[0][1],(426,25))
          if player1[0][0]&gt;player2[0][0]:
              player1.append(player1[0])
              player1.append(player2[0])
              player1.pop(0)
              player2.pop(0)
          elif player2[0][0]&gt;player1[0][0]:
              player2.append(player1[0])
              player2.append(player2[0])
              player1.pop(0)
              player2.pop(0)
  #war
          elif player1[0][0]==player2[0][0]:
              print("second card player 1",player1[4][1])
              print("second card player 2",player2[4][1])
              sleep(1)
              print("cards gained",player1[1][1],player1[2][1],player1[3][1],player2[1][1],player2[2][1],player2[3][1])
              if player1[4][0]&gt;player2[4][0]:
                  for pop in range(0,5):
                      player1.append(player1[pop])
                      player1.append(player2[pop])
                  for pop in range(0,5):
                      player1.pop(0)
                      player2.pop(0)
              elif player2[4][0]&gt;player1[4][0]:
                  for pop in range(0,5):
                      player2.append(player1[pop])
                      player2.append(player2[pop])
                  for pop in range(0,5):
  
                      player1.pop(0)
                      player2.pop(0)
              else:
                  print("draw")
              sleep(3)
      #win function
      handcount1=len(player1)
      handcount2=len(player2)
      if handcount1==52:
          win=True
          print("player 1 wins")
      else:
          wind.blit(back,(25,25))
      if handcount2==52:
          win=True
          print("player 2 wins")
      else:
          wind.blit(back,(828,260))
      pygame.display.update()
  pygame.quit()
  </code></pre>
  
  <p>The code works perfectly until I press the space bar for the first hand then it shows me this traceback error:</p>
  
  <pre><code>Traceback (most recent call last):
    File "C:\Users\PABei\Downloads\war\war.py", line 139, in &lt;module&gt;
      wind.blit(player1[0][1],(426,260))
  TypeError: 'pygame.Surface' object is not subscriptable
  </code></pre>
  
  <p>And I don't understand why. The code in these lines is supposed to put a card image n the center of the window. Sometimes the error shows different lines but they're all lines where I try to blit the card images. Strangely the backs of the cards work just fine, the only problem is on the face up cards. I've tried to add a second surface to blit the images onto but it shows up with the same error message. I just don't know what to do and would appreciate all the help I can get.</p>