Write a function to reverse the order of a list.

list1 = [10, 20, 30, 40]
user
def reverse_list(list1):
  return list1[::-1]
  
list1 = [10, 20, 30, 40]

list1 = reverse_list(list1)

print(list1)

# Output: [40, 30, 20, 10]
assistant