Python 为什么CodeEval上没有输出?
我正在参与CodeEval的FIZZ BUZZ挑战赛,以下是链接: 这是我的密码:Python 为什么CodeEval上没有输出?,python,Python,我正在参与CodeEval的FIZZ BUZZ挑战赛,以下是链接: 这是我的密码: """Sample code to read in test cases: import sys test_cases = open(sys.argv[1], 'r') for test in test_cases: # ignore test if it is an empty line # 'test' represents the test case, do something with
"""Sample code to read in test cases:
import sys
test_cases = open(sys.argv[1], 'r')
for test in test_cases:
# ignore test if it is an empty line
# 'test' represents the test case, do something with it
# ...
# ...
test = test.strip()
X, Y, N = (int(s) for s in test.split())
result = ""
for i in range(1, N+1):
if i % X == 0 and i % Y == 0:
result += "FB "
elif i % X == 0:
result += "F "
elif i % Y == 0:
result += "B "
else:
result += str(i) + " "
print (result.strip())
test_cases.close()
"""
但是,根据CodeEval,没有输出。有什么问题吗?在网站上查看后,您似乎用三重引号将所有代码括起来,这与注释代码相同。我据此更正了问题。只需删除三重引号,一切都应该正常运行在网站上检查后,您似乎用三重引号包围了所有代码,这与注释代码相同。我据此更正了问题。只需删除三重引号,一切都应该正常而不仅仅是添加链接,请使用正确的错误消息描述您面临的特定问题。而不仅仅是添加链接,请使用正确的错误消息描述您面临的特定问题。