Reading a triangle of numbers into a 2d array of ints in Python,arr = [[int(i) for i in line.split()] for line in open('input.txt')]