This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: random.shuffle() returning None
Type: behavior Stage: resolved
Components: Versions: Python 3.8
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: pablonana
Priority: normal Keywords:

Created on 2021-02-10 21:14 by pablonana, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (3)
msg386807 - (view) Author: Pablo (pablonana) Date: 2021-02-10 21:14
import random
mylist = ["apple", "banana", "cherry"]
print(random.shuffle(mylist))

Result: None
Expected result: A shuffle list

It works in Python 3.7.3 but it fails in Python 3.8.5 (Ubuntu 20.04.2)
msg386808 - (view) Author: Pablo (pablonana) Date: 2021-02-10 21:15
```
import random
mylist = ["apple", "banana", "cherry"]
print(random.shuffle(mylist))
```

Result: None
Expected result: A shuffled list

It works in Python 3.7.3 but it fails in Python 3.8.5 (Ubuntu 20.04.2)
msg386809 - (view) Author: Pablo (pablonana) Date: 2021-02-10 21:22
random shuffle is supposed to change the list in place.
History
Date User Action Args
2022-04-11 14:59:41adminsetgithub: 87363
2021-02-10 21:22:40pablonanasetstatus: open -> closed
resolution: not a bug
messages: + msg386809

stage: resolved
2021-02-10 21:15:37pablonanasetmessages: + msg386808
2021-02-10 21:14:22pablonanacreate