Question: Data from a .txt:

```
ABC 12 34 24
edf 23 15 63
hre 41 3  356
...
...

```

I want to save each word(in the first column) in a set. For each element in the set, have a list that contains each number after it. E.G. word[ABC][1] = 34, word[hre][2] = 356.

I don't find any useful information about this online.

Answer: 
You will need a dictionary mapping the keys to lists of integers:

```py
d = {}
with open("input.txt") as f:
    for line in f:
        items = line.split()
        d[items[0]] = map(int, items[1:])

```
This is a good time to use generators to conserve memory even on large files.

Here I simulate the file using a multiline string.

```
file_ = """ABC 12 34 24
edf 23 15 63
hre 41 3  356""".splitlines()

rows = (line.split() for line in file_)
pairs = ((row[0], map(int, row[1:])) for row in rows)
d = dict(pairs)

for key_ in d:
    print key_, d[key_]

"""
>>>
hre [41, 3, 356]
ABC [12, 34, 24]
edf [23, 15, 63]
"""

print d['ABC'][1]
"34"

```