Pregunta de entrevista de Civil Service United Kingdom

a basic python challenge to complete