[Tutor] Need help with find error

Андрей Пугачев pugachov.andrey at gmail.com
Wed Feb 4 10:01:54 CET 2015


Hi
I'm learning python a few weeks and have problems with code that read text
from txt-file
Code doing all right, but in the end I have error

Traceback (most recent call last):
  File "trivia_challenge.py", line 81, in <module>
    main()
  File "trivia_challenge.py", line 74, in main
    category, question, answers, correct, explanation, points =
next_block(trivia_file)
  File "trivia_challenge.py", line 37, in next_block
    points = int(next_line(the_file))
ValueError: invalid literal for int() with base 10: ''

I see it don't like empty line, but line is not emty...

py-file http://pastebin.com/9C4guZq5

txt-file http://pastebin.com/dZVs8V9P


More information about the Tutor mailing list