Skip to content

Instantly share code, notes, and snippets.

@GaryLee
Created November 18, 2015 13:52
Show Gist options
  • Save GaryLee/c3a686dcba67057da924 to your computer and use it in GitHub Desktop.
Save GaryLee/c3a686dcba67057da924 to your computer and use it in GitHub Desktop.
Short code for matrix input
input_round = lambda: range(int(raw_input('\n')))
input_size = lambda: range(int(raw_input('\n'))+1)
input_coord = lambda round, count: round if count == 0 else raw_input('').split(' ')
print [input_coord(round, count) for round in input_round() for count in input_size()]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment