Skip to content

Instantly share code, notes, and snippets.

View imran31415's full-sized avatar

Imran Hassanali imran31415

View GitHub Profile
import random
import itertools
from collections import Counter
''' BEGIN UTILITY SCRIPTS'''
# gets the most common element from a list
def Most_Common(lst):
data = Counter(lst)
return data.most_common(1)[0]
#gets card value from a hand. converts A to 14, is_seq function will convert the 14 to a 1 when necessary to evaluate A 2 3 4 5 straights
def convert_tonums(h, nums = {'T':10, 'J':11, 'Q':12, 'K':13, "A": 14}):
import itertools
from collections import Counter
# gets the most common element from a list
def Most_Common(lst):
data = Counter(lst)
return data.most_common(1)[0]
import itertools
from collections import Counter
# gets the most common element from a list
def Most_Common(lst):
data = Counter(lst)
return data.most_common(1)[0]
import sys
import itertools
#itertools used for permutations to create sets
'''
Author: Imran Hassanali
Email: develop.imran@gmail.com
'''