[Tutor] Trivia

Vincent Balmori vincentbalmori at yahoo.com
Fri Jun 24 08:56:56 CEST 2011


<<<try:

point = int(next_line(the_file))

If x is a string that can be interpreted as an integer number, int(x) is
that integer number; if the string is not the representation of an integer,
this will lead to a ValueError.

-- 
André Engels, andreengels at gmail.com>>>


It's working fine now with the scoring, but now at the end of the program
for some reason I get this error message:

Traceback (most recent call last):
  File
"/Users/vincentbalmori/Desktop/Python/py3e_source/chapter07/trivia_challenge2.py",
line 83, in <module>
    main()
  File
"/Users/vincentbalmori/Desktop/Python/py3e_source/chapter07/trivia_challenge2.py",
line 76, in main
    category, point, question, answers, correct, explanation =
next_block(trivia_file)
  File
"/Users/vincentbalmori/Desktop/Python/py3e_source/chapter07/trivia_challenge2.py",
line 27, in next_block
    point = int(next_line(the_file))
ValueError: invalid literal for int() with base 10: ''
-- 
View this message in context: http://old.nabble.com/Trivia-tp31917610p31917701.html
Sent from the Python - tutor mailing list archive at Nabble.com.



More information about the Tutor mailing list