DHI Group Interview Question

Some question about Python coding