RunestoneInteractive / fopp

Foundations of Python Programming
https://runestone.academy/runestone/static/fopp/index.html
37 stars 120 forks source link

ac4_7_8 in Section 3.7.4. ValueError demonstrates the wrong type of error #312

Closed GeekLad closed 4 years ago

GeekLad commented 4 years ago

According to the text in the textbook, the code in ac4_7_8 should generate the following error:

ValueError: invalid literal for int() with base 10: '' on line: 4

However, it has a NameError:

NameError: name 'wait_time_int' is not defined on line 5

To Reproduce Steps to reproduce the behavior:

  1. Go to https://fopp.umsi.education/books/published/fopp/Debugging/KnowyourerrorMessages.html
  2. Scroll down to section 3.7.4. ValueError
  3. Click Save & Run
  4. A NameErroris generated instead of a ValueError

Expected behavior A ValueError should be generated

Screenshots image

Desktop (please complete the following information):

bnmnetp commented 4 years ago

You are not supposed to enter a value for the first prompt. If you just click OK, as you are told to do in the text then you will get a ValueError on line 2 before you ever get to the name error.

bnmnetp commented 4 years ago

Even so, I'll fix line 5 so that the program runs correctly when given correct input.

bnmnetp commented 4 years ago

Done.