Skip to content

Instantly share code, notes, and snippets.

@idrisr
Forked from codeeval/sample.py
Created November 30, 2011 02:39
Show Gist options
  • Select an option

  • Save idrisr/1407738 to your computer and use it in GitHub Desktop.

Select an option

Save idrisr/1407738 to your computer and use it in GitHub Desktop.

Revisions

  1. @invalid-email-address Anonymous created this gist Oct 3, 2011.
    15 changes: 15 additions & 0 deletions sample.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    # On CodeEval, test cases are read in from a file which is the first argument to your program
    # Open the file and read in line by line. Each line represents a different test case
    # (unless given different instructions in the challenge description)

    import sys

    test_cases = open(sys.argv[1], 'r')

    for test in test_cases:
    # ignore test if it is an empty line
    # 'test' represents the test case, do something with it
    # ...
    # ...

    test_cases.close()