Allied Telesis Interview Question

They showed two errors in the code, letting me to analysis, locate and correct the errors