Question: I am trying to write a function that reads a file, and appends the lines of a file into a list. For example a file that reads:

```
hello
goodbye 

```

should return the list:

```
[["h","e","l","l","o"]
 ["g","o","o","d","b","y","e"]]

```

I have created a helper function splitLine that takes as input, a string and would return a list of the letters in the string. For example `"abc"` would become `["a","b","c"]`

I am having trouble inserting new lines and stripping the "\r" and "\n" from the lists. Here is my code:

```
def createGrid(filename):
    myFile = open(str(filename),"r")
    myGrid = []
    for line in myFile:
        myLine = splitLine(line)
        myGrid.append(myLine)
    return myGrid

```

Answer: 
You can probably try iterate through multiple for loops like this

```
def createGrid(filename):
    myFile = open(str(filename),"r")
    myGrid = []
    for line in myFile:
        for apl in line:
            myLine = apl.splitlines()
            myGrid.append(myLine)
    return myGrid

```
Here is another solution:

```
def createGrid(filename):
    myFile = open(str(filename),"r")
    myGrid = []
    for line in myFile:
        myGrid.append(list(line.strip()))
    return myGrid

print createGrid("input.txt")

```

**output:**

```
[['h', 'e', 'l', 'l', 'o'], ['g', 'o', 'o', 'd', 'b', 'y', 'e']]

```