'Facing empty character in list input

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']


Solution 1:[1]

That's PyCharm regression https://youtrack.jetbrains.com/issue/PY-54238/STDIN-is-lost-for-a-second-input-call

The fix is coming to 2022.1.2 (Release Candidate this week) and 2022.2.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Pavel Karateev