Instead of this, you could use `random.choice(l1)`, which will return a random element from the list.