3 months later
I found it helpful to use the VS Code extension cph2 as it allows setting testcases (input & expected output).
To read the input I used a sample from ideone.com2 :
from sys import stdin
for line in stdin:
n = int(line)
if n == 42:
break
print(n)
5 months later