For the sake of practicing how to be more comfortable and fluent in working with dictionaries, I have written a little program that reads the content of a file and adds it to a dictionary as a key: value pair. This is no problem, but when I got curious about how to print the content out again in the same format as the table in the datafile using for-loops, I ran into trouble.

***My question is: How can I print out the content of the dictionary onto the terminal using for-loops?***

***The datafile is:***

```
Name    Age     School
Anne    10      Eiksmarka
Tom     15      Marienlyst
Vidar   18      Persbråten
Ayla    18      Kongshavn
Johanne 17      Wang
Silje   16      Eikeli
Per     19      UiO
Ali     25      NTNU

```

***My code is:***

```
infile = open("table.dat", "r")
data = {}

headers = infile.readline().split()
for i in range(len(headers)):
    data[headers[i]] = []

for line in infile:
    words = line.split()
    for i in range(len(headers)):
        data[headers[i]].append(words[i])
infile.close()

```

**I would like the out print the data back onto the terminal. Ideally, the out print should look something like this**

```
Name    Age     School
Anne    10      Eiksmarka
Tom     15      Marienlyst
Vidar   18      Persbråten
Ayla    18      Kongshavn
Johanne 17      Wang
Silje   16      Eikeli
Per     19      UiO
Ali     25      NTNU

```

If someone can help me with this, I would be grateful.