So far what I have is
import random
def go():
rounds = 0
while rounds < 5:
number = random.randint(1, 5)
if number == 1:
print('a')
elif number == 2:
print('b')
elif number == 3:
print('c')
elif number == 4:
print('d')
elif number == 5:
print('e')
rounds = rounds + 1
go()
and the output ends up beings something along the lines of
e
e
c
b
e
How do I make it so a number is only used once and the letters do not repeat? (ex. something like)
a
e
b
c
d
Thanks in advance
random.sample("abcde", 5)random library python 3L = list("abcde"); random.shuffle(L)i.e., get a random permutation of"abcde"letters.