# How to correlate the answers and the questions?

``````from random import *
#codes
s1 = "c3c4v"
s2 = "67bz8"
s3 = "l67n4"
s4 = "w7a9s"
s5 = "9g8f7"
#answers
s1a = "323322"
s2a = "562267"
s3a = "1256144"
s4a = "2361819"
s5a = "8g7f6"
block.c1 = random.choices(s1,s2,s3,s4,s5)
block.c2 = random.choices(s1,s2,s3,s4,s5)
block.c3 = random.choices(s1,s2,s3,s4,s5)
block.c4 = random.choices(s1,s2,s3,s4,s5)
block.c5 = random.choices(s1,s2,s3,s4,s5)
print("code:" + block + block + block + block + block)
ans = input("enter decryption")``````

it is necessary to make a code that will relate the whole answer with the correct answer to each block
April 19th 20 at 12:05
1 answer
April 19th 20 at 12:07
Solution
``````dict = {
"c3c4v": "323322",
"67bz8": "562267",
"l67n4": "1256144",
"w7a9s": "2361819",
"9g8f7": "8g7f6",
}

block.c1 = random.choices(dict.keys())
block.c2 = random.choices(dict.keys())
block.c3 = random.choices(dict.keys())
block.c4 = random.choices(dict.keys())
block.c5 = random.choices(dict.keys())

print("code:" + block + block + block + block + block)
ans = input("enter decryption")``````

To get the value:
dict['c3c4v'] - return 323322
thank you - Theresa commented on April 19th 20 at 12:10

Find more questions by tags Python