Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def basefunc(x, y, z, index = 0):
- return len([a for a in Counter(i[index] for i in x).values() if a >= y]) >=1
- def onePair(x):
- return basefunc(x,2,1)
- def threeOfAKind(x):
- return basefunc(x,3,1)
- def twoPair(x):
- return basefunc(x,2,2)
- def straight(x):
- return len([a for a in Counter(i[0] for i in x).values() if a != 1]) == 0
- def Flush(x):
- return len(Counter(i[2] for i in x).values()) == 1
- def fullHouse(x):
- return basefunc(x,2,2) and basefunc(x,3,1)
- def straightFlush(x):
- return straight(x) and Flush(x)
- def fourOfAKind(x):
- return basefunc(x,4,1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement