Get Random Element From Array using Python

random module

import random

data = [10, 3, 17, 50, 15]
element = random.choice(data)

print(element)

Leave a Comment

Cancel reply

Your email address will not be published.