May-28-2020, 12:14 PM
You can use random.sample() to avoid repetition.
letters = random.sample(['a','b','c','d','e','f','g','h'], 4)This code will randomly select 4 values from the list of letters without any repeated values.