<reponame>ajh1143/DictionaryFairy<gh_stars>0
class dictionaryFairy(object):


    #Create Dictionary with a Zip and Loop approach
    def createDictLoop(self, keys, values):
        zipper = zip(keys, values)
        outDict = {}
        for k, v in zipper:
            outDict[k] = v
        return outDict


    #Create a Dictionary with a Dictionary Comprehension approach
    def createDictComprehension(self, keys, values):
        zipper = zip(keys, values)
        outDict = {k:v for (k, v) in zipper}
        return outDict


    #Create a Dictionary directly with a dict(zip()) approach
    def createDictDirect(self, keys, values):
        outDict = dict(zip(keys, values))
        return outDict


    #Compare Dictionary sizes, return the larger 
    def compareDicts(self, dict1, dict2):
        d1 = len(dict1)
        d2 = len(dict2)
        
        # Check if both dictionaries are empty
        if not d1 and not d2:
            print("No contents")
            return None
        
        # Check if dictionaries are the same size
        if d1 == d2:
            print("No difference")
            return None
        
        # Return the larger Dictionary with a Max() comparison
        else:
            decider = max(d1, d2)
            if d1 == decider:
                print(dict1)
                return dict1
            else:
                print(dict2)
                return dict2

class dictionaryFairy(object):


    #Create Dictionary with a Zip and Loop approach
    def createDictLoop(self, keys, values):
        zipper = zip(keys, values)
        outDict = {}
        for k, v in zipper:
            outDict[k] = v
        return outDict


    #Create a Dictionary with a Dictionary Comprehension approach
    def createDictComprehension(self, keys, values):
        zipper = zip(keys, values)
        outDict = {k:v for (k, v) in zipper}
        return outDict


    #Create a Dictionary directly with a dict(zip()) approach
    def createDictDirect(self, keys, values):
        outDict = dict(zip(keys, values))
        return outDict


    #Compare Dictionary sizes, return the larger 
    def compareDicts(self, dict1, dict2):
        d1 = len(dict1)
        d2 = len(dict2)
        
        # Check if both dictionaries are empty
        if not d1 and not d2:
            print("No contents")
            return None
        
        # Check if dictionaries are the same size
        if d1 == d2:
            print("No difference")
            return None
        
        # Return the larger Dictionary with a Max() comparison
        else:
            decider = max(d1, d2)
            if d1 == decider:
                print(dict1)
                return dict1
            else:
                print(dict2)
                return dict2
#Create Dictionary with a Zip and Loop approach #Create a Dictionary with a Dictionary Comprehension approach #Create a Dictionary directly with a dict(zip()) approach #Compare Dictionary sizes, return the larger # Check if both dictionaries are empty # Check if dictionaries are the same size # Return the larger Dictionary with a Max() comparison