I have created the following Python script named week1_1.py:
import sys
input = sys.stdin.read()
tokens = input.split()
a = int(tokens[0])
b = int(tokens[1])
print(a + b)
However, when I call it from within my Jupyter Notebook I get the following exception:
%run -i week1_1 2 3
---------------------------------------------------------------------------
IndexError Traceback (most recent call last)
D:\Mint_ns\week1_1.py in <module>()
8 input = sys.stdin.read()
9 tokens = input.split()
---> 10 a = int(tokens[0])
11 b = int(tokens[1])
12 print(a + b)
IndexError: list index out of range
What might be the cause of this exception?

print(tokens)orprint(len(tokens))show?tokensis probably an empty list.