While Loop Validation Python Compiler Matplotlib