Revolut interview question

Basic Python HackerRank test to complete