Python: If Statements and Loops