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
Mark
  • 90,562
  • 7
  • 108
  • 148
Duy Phan
  • 13
  • 1
  • 4
  • 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. – Mark Jul 22 '19 at 15:55
  • what input you are giving as we cannot split a no – AnkushRasgon Jul 22 '19 at 16:25

0 Answers0