I'm creating a program that makes a random code list and translates the text to the code. I'm having trouble figuring out how to make it so that the code is equal to a single random letter in a list.
This is the code I have so far :
loop = 0
while loop < 24:
numbers = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24]
letters = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
random.shuffle(numbers)
random.shuffle(letters)
print(numbers, "=", letters)
loop = loop + 1
if loop == 24:
print("test")
It's outputting something like this:
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24] = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
It should, in theory, look something like this when it's outputted: 1 = g, 2 = w, 3 = k, and so on.