If I have a question that I need to append a copy of list2 of size n to the end of list1 n times, is the time complexity O(n) or O(n^2)? Code is below.
for i in range(n):
list1.append(list2)
What if I append a copy of list2?
for i in range(n):
list1.append(list2[:])