-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdobble game.py
More file actions
29 lines (28 loc) · 774 Bytes
/
dobble game.py
File metadata and controls
29 lines (28 loc) · 774 Bytes
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
#Dobble Game
import string
import random
while(True):
symbol=list(string.ascii_letters)
card1=[0]*8
card2=[0]*8
pos1=random.randint(0,7)
pos2=random.randint(0,7)
samesym=random.choice(symbol)
symbol.remove(samesym)
card1[pos1]=samesym
card2[pos2]=samesym
for i in range(8):
if i!=pos1:
card1[i]=random.choice(symbol)
symbol.remove(card1[i])
if i!=pos2:
card2[i]=random.choice(symbol)
symbol.remove(card2[i])
print(card1,"\n",card2)
ans=input("Enter symbol that is same on both the cards:")
if ans==samesym:
print("Right")
else: print("Wrong")
ch=input("Continue(Y/N)?")
if ch.upper()=="N":
break