I am trying to run a program on a jupyter notebook that accepts user input, and I cannot figure out how to get it to read standard input. For example, if I run the code with shift-enter:
a = input()
print(a)
the cell indicates it is running, but does not accept input from me. How do I get it to accept input?
Use the raw_input()
(for Python 2) or input()
(for Python 3) methods.
Example code:
a = raw_input()
print(a)
Example notebook: