hackerrank python solutions finding the percentage