-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTuples
37 lines (22 loc) · 845 Bytes
/
Tuples
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Task
Given an integer, , and space-separated integers as input, create a tuple, , of those integers. Then compute and print the result of hast(t).
Note: hash() is one of the functions in the __builtins__ module, so it need not be imported.
Input Format
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.
Output Format
Print the result of hash(t).
Sample Input 0
2
1 2
Sample Output 0
3713081631934410656
________________________________________________________________________________
python
Copy code
n = int(input())
elements = list(map(int, input().split()))
t = tuple(elements)
hash_value = hash(t)
print(hash_value)
Now you can run this code with the provided sample input to get the expected output.