Hackerrank Print Function Python Solution