我正在使用 Python 2在http://hackerrank.com上解决一个问题
编译器给出错误
回溯(最后一次调用):文件“/run-Lx3mHJ3G2jHRLRW9bjbX/solution.py”,第 4 行,在 t = raw_input() EOFError: EOF 读取一行时
这是代码:
import sys
a = []
while 1:
t = raw_input()
if t=="":
break
else:
s = [i for i in t]
s.reverse()
a.append(s)
a.reverse()
for i in a:
for j in i:
sys.stdout.write(j)
sys.stdout.write('\n')
当我在我的电脑上运行它时,它工作正常。
这是我应该向 HackerRank 解释器报告的问题,还是我做错了什么?
为了获得完整的信息,我已经尝试过使用“input()”、“str(input())”和其他可能的变体。