Python Interviews: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 68:
b = [j for j in arr if j != mx]
print(max(b))
 
*List to Tuple Conv & Hashing:
>>> a = [1,2,3,45,6,7]
>>> a
[1, 2, 3, 45, 6, 7]
 
>>> tuple(a)
(1, 2, 3, 45, 6, 7)
 
>>> hash(tuple(a))
1409902629973635913