第 5 步:我们现在已准备好处理用户可能因无效输入而导致的任何错误。让我们问这个问题!
- 首先删除try语句下面的x · = · 5 · / · 0 。
- 在图形和,将Ask for Integer拖入try语句内,缩进3次!
- 将guess更改为scoops并将问题更改为"How many scoops would you like?"
- 输入不是数字的输入将导致运行时错误并停止程序。不能有这种事!
To navigate the page using the TAB key, first press ESC to exit the code editor.