IBM Interview Question

Simple python code were asked