In this HackerRank Tuples problem we have given an integer, n, and n space-separated integers as input, create a tuple, t, of those n integers. Then compute and print the result of hash(t).

HackerRank Tuples in python problem solution

HackerRank Tuples in python problem solution

# Enter your code here. Read input from STDIN. Print output to STDOUT
n = int(raw_input())
vals = raw_input().split()
lst = []
for i in range (0, n):
    lst.append(int(vals[i]))

print hash(tuple(lst))

Second solution

N = int(input())
l = map(int, input().split())
print(hash(tuple(l)))