Tuples in python – HackerRank SOlution
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) .
Note: hash() is one of the functions in the
__builtins__ module, so it need not be imported.
The first line contains an integer,n , denoting the number of elements in the tuple.
The second line contains n space-separated integers describing the elements in tuple t.
Print the result of hash(t).
Sample Input 0
2 1 2
Sample Output 0
#Tuples in python - HackerRank SOlution if __name__ == '__main__': n = int(raw_input()) t = tuple(map(int, raw_input().split())) print(hash(t)) #Tuples in python - HackerRank SOlution
Disclaimer: This problem is originally created and published by HackerRank, we only provide solutions to this problem. Hence, doesn’t guarantee the truthfulness of the problem. This is only for information purposes.