How to read user input until EOF in python?

前端 未结 5 1464
囚心锁ツ
囚心锁ツ 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 13:07

    For HackerRank and HackerEarth platform below implementation is preferred:

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

提交回复
热议问题