TEKsystems Interview Question

puzzle que, java and Python related que