Complete the code to define the function that starts the lexical analysis.
def [1](source_code):
The function that begins the lexical analysis is commonly called lexical_analyzer or similar, as it processes the source code into tokens.
Complete the code to read the next character from the source code string.
current_char = source_code[[1]]The variable index is typically used to track the current position in the source code string to read characters one by one.
Fix the error in the condition to check if the current character is a digit.
if current_char [1] '0' and current_char [2] '9':
To check if a character is a digit, it must be greater than or equal to '0' and less than or equal to '9'.
Fill both blanks to create a dictionary comprehension that maps tokens to their types for all tokens longer than 2 characters.
token_types = {token: [1] for token in tokens if len(token) [2] 2}The dictionary maps each token to the string 'identifier' if its length is greater than 2.
Fill all three blanks to create a dictionary comprehension that maps uppercase tokens to their lengths if length is at least 3.
result = { [1]: [2] for [3] in tokens if len([3]) >= 3 }The comprehension maps each token converted to uppercase (token.upper()) to its length (len(token)) for tokens named token with length at least 3.