+ 1
Why this doesn't raise EOFError?
I wrote this based on pitmob code on the challenge, for taking multiple lines of entry. Problem is, Empty input doesn't raise any exceptions, and the while loop never breaks. while True: try: print(input().title()) except EOFError: break Any suggestions? https://code.sololearn.com/ci07b842jrU0/?ref=app
3 Respostas
+ 2
use this
while True:
try:
a=input ()
if a:
print a.title()
else:
break
except:
break
+ 2
Unfortunately, this one faces EOFError, the last time it tries to get the input.
0
check edited answer