def add_line_numbers(source_code):
    lines = source_code.splitlines()
    last_line_num_length = len(str(len(lines)))
    return '\n'.join(((('%%%sd: %%s' % last_line_num_length) % ((n + 1), line)) for (n, line) in enumerate(lines)))
def add_line_numbers(source_code):
    lines = source_code.splitlines()
    last_line_num_length = len(str(len(lines)))
    return '\n'.join(((('%%%sd: %%s' % last_line_num_length) % ((n + 1), line)) for (n, line) in enumerate(lines)))