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.
raw_input()
input()
Example code:
a = raw_input() print(a)
Example notebook:
1.4m articles
1.4m replys
5 comments
57.0k users