1. The reverse() method
reverse() is a built-in method of the list in python (there is no such built-in method in dictionaries, strings and tuples), which is used to reverse the data in the list
Note that the return value of the lista.reverse() operation is None, and the result of its action needs to be printed to see the specific effect of the list.
2. The reversed() function
reserved() is one of python's built-in functions. Its function is to return an iteration of a reversed sequence for a given sequence (including lists, tuples, strings, and range(n) intervals). The syntax format of the operator (for traversing the reverse sequence)
:
reversed(seq)
seq can be a list, an element, a string, and a range list generated by range()
Note: Using the reversed() function to reverse the order will not modify the order of elements in the original sequence.
When b gets the flip value of a, add list(xxx)