#1 Don’t use .append() repeatedly, use .extend() — 1. Use x.extend(…) instead of repeatedly calling x.append() When appending multiple values to a list, you can use the .extend() method to add an iterable to the end of an existing list. This way, you don’t have to call .append() on every element: Bad nums = [1, 2, 3] nums.append(4)
nums.append(5)
nums.append(6) Good nums = [1, 2, 3] nums.extend((4, 5…