0

I use google colab to run this code, it gets a problem but when I run it in jupyter notebook, it seems ok. I don't know why. Someone can help me. Thanks a lot.

tokens = input("Enter a number: ")
tokens = tokens.split()
a = int(tokens[0])
b = int(tokens[1])
print(a + b)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-51-67bc049ba749> in <module>()
----> 1 tokens = input("Enter a number: ")
      2 tokens = tokens.split()
      3 a = int(tokens[0])
      4 b = int(tokens[1])
      5 print(a + b)

TypeError: 'str' object is not callable
2
  • 8
    Did you overwrite input somewhere by using something like input = ...? A notebook like Colab will remember that. You can try del input to clear your overwrite. Commented Jul 22, 2019 at 15:55
  • what input you are giving as we cannot split a no Commented Jul 22, 2019 at 16:25

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.