Append and Reverse List Function

  • Share this:

Code introduction


This function takes a list and a value to append, appends the value to the end of the list, and then returns the reversed list.


Technology Stack : list

Code Type : List operation

Code Difficulty :


                
                    
def append_and_reverse(input_list, append_value):
    """
    将一个值追加到列表的末尾,然后返回反转后的列表。
    """
    input_list.append(append_value)
    return input_list[::-1]                
              
Tags: