Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- House_deal = random.sample(range(9), k=5)
- Player_deal = random.sample(range(9), k=5)
- hc = Counter(House_deal)
- pc = Counter(Player_deal)
- common = hc.keys() & pc.keys() #get the intersection of both keys
- counts = 0
- for cel in common:
- counts += min(hc[cel], pc[cel])
- if counts == 0:
- common_0 += 1
- elif counts == 1:
- common_1 += 1
- elif counts == 2:
- common_2 += 1
- elif counts == 3:
- common_3 += 1
- elif counts == 4:
- common_4 += 1
- elif counts == 5:
- common_5 += 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement