While Loop and Nested while Loop in Python