Results.txt file for Chapter 4 exercises

1 view
Skip to first unread message

Greg Hills

unread,
Nov 14, 2009, 7:07:38 PM11/14/09
to learnpython
Hi All,

I've been working on the chapter 4 exercises and I feel as though the
"results.txt" file I created may be improperly formatted. When I run a
program, which in some instances is copied directly from the text
book, I get the following error message:

Traceback (most recent call last):
File "/Users/ghills/Documents/Personal Stuff/Python Class/Chapter 4
Exercises/exercise p. 123_v2", line 5, in <module>
(name, score) = line.split()
ValueError: need more than 1 value to unpack

Here's how I've set up my results.txt file:

Johnny 8.65
Juan 9.12
Joseph 8.45
Stacey 7.81
Aideen 8.05
Zack 7.21
Aaron 8.31


Would someone be kind enough to post a "results.txt" file that worked
for them, or e-mail it to me directly?

Rathan Haran

unread,
Nov 14, 2009, 7:14:41 PM11/14/09
to learn...@googlegroups.com
You may have blank lines in your results.txt file.  This one should work.
--
www.wixity.com
www.webinometry.com
results.txt

Greg Hills

unread,
Nov 14, 2009, 7:19:21 PM11/14/09
to learn...@googlegroups.com
Thanks a lot Rathan, your file worked. I realize now that I created an .rtf file in TextEdit, then changed the extension myself to .txt. That was the problem.

Charlie O'Donnell

unread,
Nov 14, 2009, 7:36:20 PM11/14/09
to learn...@googlegroups.com
You guys have seen this, right?

http://www.headfirstlabs.com/books/hfprog/

You don't need to writeup these text files from scratch.

> www.wixity.com <http://www.wixity.com>
> www.webinometry.com <http://www.webinometry.com>
>
>

Greg Hills

unread,
Nov 15, 2009, 8:58:04 AM11/15/09
to learn...@googlegroups.com
I hadn't seen that, probably because I didn't attend the first sessions in person. Thanks Charlie.
Reply all
Reply to author
Forward
0 new messages