from sys import argv

from examples.connect4.connect4 import Connect4Network


if __name__ == '__main__':
    if argv[1] == 'connect4':
        Connect4Network().play()

from sys import argv

from examples.connect4.connect4 import Connect4Network


if __name__ == '__main__':
    if len(argv) > 1:
        if argv[1] == 'connect4':
            Connect4Network().play()

Check length of argv before accessing it
Check length of argv before accessing it

  from sys import argv
  
  from examples.connect4.connect4 import Connect4Network
  
  
  if __name__ == '__main__':
+     if len(argv) > 1:
-     if argv[1] == 'connect4':
+         if argv[1] == 'connect4':
-         Connect4Network().play()
+             Connect4Network().play()
  
Check length of argv before accessing it
## Code Before:
from sys import argv

from examples.connect4.connect4 import Connect4Network


if __name__ == '__main__':
    if argv[1] == 'connect4':
        Connect4Network().play()

## Instruction:
Check length of argv before accessing it
## Code After:
from sys import argv

from examples.connect4.connect4 import Connect4Network


if __name__ == '__main__':
    if len(argv) > 1:
        if argv[1] == 'connect4':
            Connect4Network().play()
