LLD - Design — Food Delivery System
Given this simplified state machine code snippet:
What will be the output if
state = 'placed'
event = 'ship_order'
if state == 'placed' and event == 'ship_order':
state = 'shipped'
elif state == 'shipped' and event == 'deliver_order':
state = 'delivered'
print(state)What will be the output if
event = 'deliver_order' when state = 'placed'?