Facing empty character in list input

Viewed 60

Was trying to make a code that adds 4 inputted numbers

r=[]
for item in range(1,5):
    r.append(input())
print(r)

But I am facing an issue in PyCharm of getting a null character in between inputs The output received is as follows

6
7
8
['6', '', '7', '']

Process finished with exit code 0

The same error wasn't replicated on another laptop with PyCharm. Tried running this code on Jupyter notebook on the same machine but the error wasn't occurring. for ref my Jupyter output was (which should be the ideal output)

1
4
56
6
['1', '4', '56', '6']
1 Answers
Related