Quantiphi interview question

Some python codes like Armstrong, prime number