Hi. I have been having trouble doing the basic TEST task in Python3. I always get a NZEC if I use exit() (no matter if I specify the exit code or not):
from sys import stdin
for line in stdin:
if line.startswith('42'):
exit(0)
else:
print(line)
If I change exit(0) to break it works. There are also no such problems with python2 and exit(0) - you can literally take the code I pasted above as it doesn't use any P3 features.
Why does the exit() in Python3 cause the program to fail always? And why does it work in Python 2?
After all, Python 2 seems much faster (0.02 vs 0.12) so I will probably go on using this one, but I like to know such things ;d
A side question - does the engine take languages / runtimes into account, and adapt memory / time limits to it? So that a submission in Python can take more mem / time than in C?
Regards.