NatWest Group interview question

Basic programs on strings and series