newHash = {} dip = "hola" if dip in newHash: newHash[dip] +=1 else: newHash[dip] = 1 print newHash