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
|
1872 Discussions
|
Please Login in order to post a comment
This task is made for Python 2. Python 3 generates a different hash value that fails tests.
use python2 and paste the below code it will run successfully
if name == 'main': n = int(raw_input()) integer_list = map(int, raw_input().split()) t = tuple(integer_list) # convert list to tuple print hash(t)
hash returns differnt kinds of values in python 2 and python 3. Python 3 changed hash to always be random.
Uses
python 2andraw_inputfor this one.I faced error in solving problem in python3, due to negative values. But you solve the problem in the python 2 the same code will work. Try it