Macquarie Group Interview Question

Python and mental math questions