Generare codice Python per appiattire una lista bidimensionale.
'list1 = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]' si traduce in italiano come 'lista1 = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]'.
def flatten_two_dimensional_list(list1):
    flattened_list = [item for sublist in list1 for item in sublist]
    return flattened_list

list1_flattened = flatten_two_dimensional_list(list1)
print(list1_flattened)  # [1, 2, 3, 4, 5, 6, 7, 8, 9]

Traduci il seguente testo in italiano: 'def flatten_two_dimensional_list(list1):
    flattened_list = [item for sublist in list1 for item in sublist]
    return flattened_list

list1_flattened = flatten_two_dimensional_list(list1)
print(list1_flattened)  # [1, 2, 3, 4, 5, 6, 7, 8, 9]'