-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
45 lines (33 loc) · 847 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import random
d = {1: "lol", 2: "sdf", 345: "c"}
def randFromDict(Dictt):
dl = list(Dictt.keys())
# print(dl)
rand_key = random.choices(dl)[0]
# print(rand_key)
rand_value = d[rand_key]
# print(rand_value)
return rand_key, rand_value
rk, rv = randFromDict(d)
print(rk)
print(rv)
list = list(d.values())
list.remove(rv)
dop0 = (random.choices(list))[0]
print("dop0", dop0)
dop1 = str(dop0)
while dop1 == dop0:
dop1 = random.choices(list)[0]
print("dop1", dop1)
listOfChoices = [rv, dop0, dop1]
print(listOfChoices)
listOfChoicesRand = listOfChoices
while listOfChoices == listOfChoicesRand:
listOfChoicesRand = random.sample(listOfChoices, len(listOfChoices))
print(listOfChoicesRand)
i = input("write your answer:")
if i == rv:
print('right!')
else:
print("sorry? but it is ", rv)
print(rv)