Morgan Stanley interview question

I had to answer basic python questions on the technical interview.