SoFunction
Updated on 2024-12-13

Python's use of upsetting the order of a list

Python's () function can be used to disorganize sequences, which breaks the sequence in itself rather than generating a new one.

Example:

from random import shuffle
x = [[i] for i in range(10)]
shuffle(x)

shuffle() returns None and the order of list x is broken.

The above this Python using () to upset the order of the list is all I have to share with you, I hope to give you a reference, and I hope you support me more.