Questenaتمرینی که نشان می‌دهد بعد چه چیزی را مرور کنید
سؤال 96

Which statement correctly distinguishes else and finally in a try statement?

  1. Else needs an exception-free try; finally runs on either outcome.پاسخ درست
  2. Else handles exceptions that no except clause matches.
  3. Finally runs only when an exception occurs.
  4. Else and finally have interchangeable conditions.

توضیح

The else suite is reserved for the path where the try suite raises no exception, while finally runs as control leaves the construct on either outcome. Treating else as an unmatched-exception handler or finally as exception-only erases their different roles.

ادامهٔ این آزمون

شروع تمرین
سؤال 96: Which statement correctly distinguishes else and finally in… · Python Fundamentals · Questena