Basic Lexer for Compiler Design in Python