IBM interview question

Simple python code were asked