Question: I have a file with questions and answers on the same line, I want to seperate them and append them to their own empty list but keep getting this error:  

`builtins.ValueError: need more than 1 value to unpack`

```
questions_list = []
answers_list = []

questions_file=open('qanda.txt','r')

for line in questions_file:
    line=line.strip()

    questions,answers =line.split(':')

    questions_list.append(questions)
    answers_list.append(answers)

```

Answer: 
Try:

```
question, answers = line.split(':', maxsplit=1)
question, __, answers = line.partition(':')

```

Also in Python 3 you can do something else:

```
question, *many_answers = line.split(':')

```

which looks like:

```
temp = line.split(':')
question = temp[0]
many_answers = tuple(temp[1:])

```
The reason why this happens could be a few, as already covered in the other answers. Empty line, or maybe a line only have a question and no colon. If you want to parse the lines even if they don't have the colon (for example if some lines only have the question), you can change your split to the following:

```
questions, answers, garbage = (line+'::').split(':', maxsplit=2)

```

This way, the values for `questions` and `answers` will be filled if they are there, and will be empty it the original file doesn't have them. For all intents and purposes, ignore the variable `garbage`.