You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The `shuffle()` function can be used to shuffle the items in a sequence (`list` or `str`). The function modifies the original sequence, so there's no return value.
1956
+
1957
+
```python
1958
+
from random import shuffle
1959
+
1960
+
# Get an integer between 1 and 10
1961
+
answers = ["Five", "Seven", "Eight"]
1962
+
shuffle(answers)
1963
+
1964
+
print(answers) # ['Seven', 'Eight', 'Five']
1965
+
```
1966
+
1953
1967
_Further Reading_
1954
1968
1955
1969
-[The Python Standard Library](https://docs.python.org/3/library/index.html)
0 commit comments