10个Python 面试问题和答案代码
def swap_first_last(lst): lst[0], lst[-1] = lst[-1], lst[0] return lst# Examplemy_list = [1, 2, 3, 4, 5]print("Original List:", my
def swap_first_last(lst): lst[0], lst[-1] = lst[-1], lst[0] return lst# Examplemy_list = [1, 2, 3, 4, 5]print("Original List:", my