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.
- Prepare
- Python
- Basic Data Types
- Tuples
- Discussions
Tuples
Tuples
Sort by
recency
|
1853 Discussions
|
Please Login in order to post a comment
This problem was created for Python version 2.
Note: use
raw_input()
function to take input in python 2Use Python 2 for the solution! The question is giving correct solution only when we are using python 2 maybe the question was made using it : )
why its showing wrong answer
Yep, getting -3550055125485641917 as hash(t) output for given 1, 2 input on Python 3.12 using my code based on list comprehension as well as crosschecking with map() based solution. Sadly, nobody would ever use legacy Python2 nowadays ;-(, last time I remember was on Jython, but feels like eternity ...
use python 2 with this solution:
if name == 'main':
n = int(raw_input())
print hash(elements)