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.
Hey guuys i am new to python and i tried the following code :
size=int(raw_input())
for i in range(size):
inputs=int(raw_input()).strip().split(" ")
ttuple=tuple(inputs)
print hash(ttuple)
and got the following error:
Traceback (most recent call last):
File "solution.py", line 5, in
inputs=int(raw_input()).strip().split(" ")
ValueError: invalid literal for int() with base 10: '1 2'
What is the problem with my code?
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 →
Hey guuys i am new to python and i tried the following code : size=int(raw_input()) for i in range(size): inputs=int(raw_input()).strip().split(" ")
ttuple=tuple(inputs) print hash(ttuple)
and got the following error: Traceback (most recent call last): File "solution.py", line 5, in inputs=int(raw_input()).strip().split(" ") ValueError: invalid literal for int() with base 10: '1 2'
What is the problem with my code?