If Condition Inside While Loop In Python Syntax