You are viewing a single comment's thread. Return to all comments →
I think I could have solved this particular problem without really needing to know how many numbers are going to be in the second line.
Let's say we only have numbers as the input:
1 2
numbers = raw_input().strip().split() for i in range(len(numbers)): numbers[i] = int(numbers[i]) T = tuple(numbers) print hash(T)
Am I missing something? Edit: I just learned that I can use map to convert all the strings in a list to integers! No need of that for loop too!
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 →
I think I could have solved this particular problem without really needing to know how many numbers are going to be in the second line.
Let's say we only have numbers as the input:
1 2
Am I missing something? Edit: I just learned that I can use map to convert all the strings in a list to integers! No need of that for loop too!