Python uses indentation to define block structures, making the handling of whitespace significant at the lexer level. The lexer in Python is responsible for recognizing changes in indentation levels and converting them into tokens. These tokens are critical for the parser to understand the structure of the program.