Skip to content

Instantly share code, notes, and snippets.

@Tarrasch
Last active March 21, 2017 01:11
Show Gist options
  • Save Tarrasch/38fe96b02f87a2cfe45f30f7f7306e5e to your computer and use it in GitHub Desktop.
Save Tarrasch/38fe96b02f87a2cfe45f30f7f7306e5e to your computer and use it in GitHub Desktop.

Revisions

  1. Tarrasch revised this gist Mar 21, 2017. 1 changed file with 7 additions and 0 deletions.
    7 changes: 7 additions & 0 deletions read_stdin_lines.py
    Original file line number Diff line number Diff line change
    @@ -11,3 +11,10 @@ def main():

    if __name__ == '__main__':
    main()

    # Note, HackerRank on the other hand uses the style below:

    n = int(input())
    for i in range(n):
    a, b = input().strip().split(' ')
    print (int(a) + int(b))
  2. Tarrasch created this gist Mar 21, 2017.
    13 changes: 13 additions & 0 deletions read_stdin_lines.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    import sys


    def main():
    stdin_lines = []
    for line in sys.stdin:
    if line.strip() != "":
    stdin_lines.append(line.strip())

    # ... My code here ...

    if __name__ == '__main__':
    main()