Final answer:
To write the function append1() that takes an argument n and returns a list, you can use a loop to iterate from 1 to n. Within the loop, you can use the append () method to extend the list by one element at each iteration. Finally, you can return the list.
Step-by-step explanation:
To write the function append1() that takes an argument n and returns a list, you can use a loop to iterate from 1 to n. Within the loop, you can use the append() method to extend the list by one element at each iteration. Finally, you can return the list.
def append1(n):
x = []
for i in range (1, n+1):
x.append(i)
return x