How to read user input until EOF in python?

前端 未结 5 1443
囚心锁ツ
囚心锁ツ 2020-12-14 12:19

I came across this problem in UVa OJ. 272-Text Quotes

Well, the problem is quite trivial. But the thing is I am not able to read the input. The input is provided in

5条回答
  •  既然无缘
    2020-12-14 12:50

    This how you can do it :

    while True:
       try :
          line = input()
          ...
       except EOFError:
          pass
    

提交回复
热议问题