random.choice: Get a Randomly Selected Element from a Python List

random.choice: Get a Randomly Selected Element from a Python List

Besides getting a random number, you can also get a random element from a Python list using random. In the code above, “watch movie” was picked randomly from a list of options.

Scroll to Top

Work with Khuyen Tran

Work with Khuyen Tran