Finding an erased decision result

An event venue charges 12 dollars for every registered attendee above its included capacity. The programmer writes the Python code below. Calculate the invoice produced by the original code, then the invoice after deleting only the unindented extra_attendees = 0 line immediately before the invoice calculation. Give both amounts in dollars to two decimal places.


Python
registered = 150
included_capacity = 140

if registered > included_capacity:
    extra_attendees = registered - included_capacity
else:
    extra_attendees = 0

extra_attendees = 0
invoice = extra_attendees * 12
Your answers

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 Decision Statements Questions: