Double Hashing Code In Python