We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
While this problem provides n as input, it's not actually needed in the solution. This longer version of the code is provided as an alternative for programmers who aren't yet comfortable using map() and prefer a more step-by-step approach.
if name == 'main':
n = int(input())
numbers = input().split()
int_list = []
for num in numbers:
int_list.append(int(num))
t = tuple(int_list)
print(hash(t))
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Tuples
You are viewing a single comment's thread. Return to all comments →
While this problem provides n as input, it's not actually needed in the solution. This longer version of the code is provided as an alternative for programmers who aren't yet comfortable using map() and prefer a more step-by-step approach.
if name == 'main':