A crash and a quiet wrong answer

A student writes two short Python programs. Neither contains a grammar mistake, so Python accepts both files and starts running them.


Program 1 should display a test score:


Python
score = 95
print("Your score is " + score)


Program 2 should convert 20 °C to degrees Fahrenheit:


Python
c = 20
f = c * 9 / 5 + 23
print(f)


When Program 1 reaches line 2, Python stops and reports a , so its defect is a error. Program 2 finishes without any message, but its printed value is degrees lower than the correct 68 °F, so its defect is a error.

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More Bug Types (Syntax, Runtime, Logic) Questions: