While Loop And If Statement Python Format