IBM interview question

python is an algorithm one