A ticket system runs the following Python code. Select every true statement about which instructions execute and what the system displays.
seats_left = 0 if seats_left > 0: message = "Available" else: message = "Sold out" print(message)
The final print is skipped because no seats remain.
Only the else assignment executes during the decision.
The final print executes and displays Sold out.
Both message assignments execute before the final print.
Unlock full course notes by signing up
Tracing a shipping decision in order
An online store uses the Python program below to work out what a customer owes. Orders of 50 dollars or more ship free; smaller orders pay a flat shipping charge.
A customer enters 42.50. Put the events of this run in the order the computer carries them out.
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.
A branch that changes the tested value
A teacher adjusts quiz scores with the Python program below. Students who scored 50 or more receive 10 bonus points, and everyone else receives 25 bonus points.
Give the number printed for each of the three inputs below, as a whole number.
Input 40