Built-in functions: memory-related id, hash

id: Displays the variable memory address
a = {}
print(id(a))
hash: the hash variable data type is not available, the number of immutable types hash 
may be a hash of the hash function returns the type of a call to a hash value, the hash function will not call the given hash
= I [0,1,2 ] 
L = (0,1,2 ) 
K = L
 # Print (the hash (I)) # error 
Print (the hash (L)) # Returns a hash value 
Print (the hash (K) ) # same variable content, at the same time to perform, the same hash value

 

 
 

Guess you like

Origin www.cnblogs.com/aizhinong/p/11404665.html