(original) (raw)
import time,collections s = "Hallo" t = "Welt" it = [None]*1000000 d = collections.defaultdict(lambda:0) start=time.time() for x in it: d[s,t] += 1 stop=time.time() print(stop-start)
import time,collections s = "Hallo" t = "Welt" it = [None]*1000000 d = collections.defaultdict(lambda:0) start=time.time() for x in it: d[s,t] += 1 stop=time.time() print(stop-start)