Why does my program work in PyCharm but in online interpreter gives this error:
Traceback (most recent call last): File "Solution.py", line 4, in s = input() EOFError: EOF when reading a line
Here's the part of code that matters:
i = 0
while True:
s = input()
if s == '':
break
else:
...
I'm trying to input strings until empty string occurs but it always gets stuck on line with empty string. Thanks in advance and sorry if I'm sloppy with my question (my 1st question).
input(), but it's impossible to tell without any further information. - Sebpasscommand for the missingelseclause, the code operates as expected. Your error message suggests that the source file abruptly ends at line 4. - Prune