Assignment1 - Translate Perl to Python