Junior — Middle
What does the append method do in Python lists?
sobes.tech AI
Answer from AI
The append method in Python lists adds a single element to the end of the list.
Example:
my_list = [1, 2, 3]
my_list.append(4)
print(my_list) # Outputs: [1, 2, 3, 4]
Thus, append modifies the original list by extending it with one element.