title: My pygame isn't working but everything seems fine
body: <p>Everything seems fine but my computer found that i have invalid syntax and it marks colon(:). 
  code:</p>
  
  <pre><code>if keys[pygame.K_RIGHT] and man.x &lt; 500 - man.width: # &lt;- here he marks this colon
          man.x = man.x + man.vel
          man.right = True
          man.left = False
          man.standing = False
  </code></pre>
  
  <p><strong>Full code:</strong></p>
  
  <pre><code>import pygame
  pygame.init()
  
  cl = pygame.time.Clock()
  
  lefty = [pygame.image.load('Game/L1.png'),pygame.image.load('Game/L2.png'),pygame.image.load('Game/L3.png'),pygame.image.load('Game/L4.png'),pygame.image.load('Game\L5.png'),pygame.image.load('Game/L6.png'),pygame.image.load('Game/L7.png'),pygame.image.load('Game/L8.png'),pygame.image.load('Game/L9.png')]
  righty = [pygame.image.load('Game/R1.png'),pygame.image.load('Game/R2.png'),pygame.image.load('Game/R3.png'),pygame.image.load('Game/R4.png'),pygame.image.load('Game/R5.png'),pygame.image.load('Game/R6.png'),pygame.image.load('Game/R7.png'),pygame.image.load('Game/R8.png'),pygame.image.load('Game/R9.png')]
  gr = pygame.image.load('Game/bg.jpg')
  st = pygame.image.load('Game/standing.png')
  
  win = pygame.display.set_mode((500,480))
  name = pygame.display.set_caption("photo game")
  
  class player(object):
      def __init__(self, x, y, width, height):
          self.jumpCount = 10
          self.jump=False
          self.x = x
          self.y = y
          self.width = width
          self.height = height
          self.vel = 5
          self.left = False
          self.right = False
          self.walkCount= 0
          self.standing = True
  
      def draw(self,win):
          if self.walkCount+1&gt;=27:
              self.walkCount=0
          if not(self.standing):
              if self.left:
                  win.blit(lefty[self.walkCount//3],(self.x,self.y))
                  self.walkCount +=1
              elif self.right:
                  win.blit(righty[self.walkCount//3],(self.x,self.y))
                  self.walkCount +=1
          else:
              if self.right:
                  win.blit(righty[0], (self.x, self.y))
              else:
                  win.blit(lefty[0], (self.x, self.y))
  
  class projectiles(object):
      def __init__(self,x,y,radius,color,facing):
          self.x = x
          self.y = y
          self.radius = radius
          self.color = color
          self.facing = facing
          self.vel = 8 * facing
  
      def draw(win, self):
          pygame.draw.radius(win, self.color, (self.x, self.y), self.radius, self.facing)
  
  def redrawchar():
      win.blit(gr,(0,0))
      man.draw(win)
      for bullet in bullets:
          bullet.draw(win)
      pygame.display.update()
  
  man = player(50, 420, 62, 62)
  while True:
      cl.tick(27)
      bullets = []
  
      for events in pygame.event.get():
          if events.type == pygame.QUIT:
              break
  
      for bullet in bullets:
          if bullet.x &lt; 500 and bullet.x &gt; 0:bullet.x += bullet.vel
          else: bullets.pop(bullets.index(bullet))
  
      for events in pygame.event.get():
          if events.type == pygame.QUIT:
              break
  
      keys = pygame.key.get_pressed()
      if keys[pygame.K_c]:
          if man.right:
              facing=1
          else:
              facing = -1
          if len(bullets) &lt; 5:
              bullets.append(projectiles((round(man.x + man.weight //2)), (round(man.y + man.height //2)), 6, (0,0,0), facing)
  
      if keys[pygame.K_RIGHT] and man.x &lt; 500 - man.width: #here is that error
          man.x = man.x + man.vel
          man.right = True
          man.left = False
          man.standing = False
  
      elif keys[pygame.K_LEFT] and man.x &gt; man.vel-5-5:
          man.x-=man.vel
          man.left = True
          man.right = False
          man.standing = False
  
      else:
          man.standing = True
          man.walkCount=0
      if not(man.jump):
          if keys[pygame.K_SPACE]:
              man.jump = True
              man.right = False
              man.left = False
              man.walkCount=0
      else:
          if man.jumpCount&gt;=-10:
              man.y -= (man.jumpCount*abs(man.jumpCount)) *0.5
              man.jumpCount -=1
          else:
              man.jumpCount = 10
              man.jump = False
  
      redrawchar()
  pygame.quit()
  </code></pre>
  
  <p>I tryed to put 500 - man.width in brackets like (500 - man.width): but it's not working.</p>
  
  <p>Can someone please help.</p>
  
  <p>I am working in py 3.7 and everything is ok and seems to be right. However why does my computer not like that colon(:) for some reason?</p>
  
  <p>Does anyone have any ideas why?</p>