If Inside While Loop Python Problems