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
|
1816 Discussions
|
Please Login in order to post a comment
guys pleas do not run your code on python 3. run your code on python2 for acheive correct value of hash otherwise in python3 the output is defferent because of python3 is more strict for security on hackerrank Top-right side you have option to which python2 or python3 if you not understand copy my this guidence on chatgpt he will clear it all the best. and use raw_input() method except input() method in code.
if name == 'main': n = int(raw_input()) integer_list = map(int, raw_input().split()) t = tuple(integer_list) print hash(t)
try this using python 2. lol
Why is not working?
**The code is working only in PyPy3 (Since The hash() function in Python is not guaranteed to return the same value - This is expected behavior, not a bug.) **
if name == 'main': n = int(input()) integer_list = map(int, input().split()) t = tuple(integer_list) print(hash(t))
Here is Tuples python solution - https://programmingoneonone.com/hackerrank-tuples-problem-solution-in-python.html