inputs = list(map(int, input().split()))
print(n)
print(inputs)
When I input 3 4 in the console below; I get the following error:
Traceback (most recent call last):
File "/Users/Labhesh/PycharmProjects/algotoolbox/assignment1/test.py", line 2, in <module>
inputs = list(map(int, input().split()))
File "<string>", line 1
3 4
^
SyntaxError: unexpected EOF while parsing
Process finished with exit code 1
When I run the same code from command line, there are no issues:
>> python3 test.py
>> 3 4
>> [3, 4]
Is there some special setting I have to do to make this simple code work in PyCharm?
EDIT
It seems that in pycharm project interpreter is not the same as run configuration. To set Run configuration - use Run --> Edit Configuration and then choose the python interpreter.
You can also do
import sys
print(sys.version)
to print the runtime version
