detect_rack_handler' from
\\..gem/ruby/1.8/gems/sinatra-1.4.6/lib/sinatra/base.rb:1437:in
请帮忙!
顺便说一句,使用building = [["Farm","-1","0","F","1","1","-1"],
["Plot","0","0","P","1","0","-1"],
["House","20","4","H","0","0","5"]]
cmd = input(">")
if (cmd == "build"):
c = 0
length = len(building)
while (c < length):
bu = building(c)
print(c + ") " + bu[0])
c = c + 1
我得到:
e = sys.exc_info()
答案 0 :(得分:0)
这里有固定代码:
building = [ ["Farm","-1","0","F","1","1","-1"], ["Plot","0","0","P","1","0","-1"], ["House","20","4","H","0","0","5"]]
cmd = input(">")
if (cmd == "build"):
c = 0
length = len(building)
while (c < length):
bu = building[c]
print(str(c) + ") " + bu[0])
c = c + 1
修复了什么:
- 缩进
- 调用列表构建 - ()而不是[]
- str(c)in print,因为c是int而你不能求和和
此外,import sys
在使用e = sys.exc_info()
答案 1 :(得分:0)
我明白了!我导入了一个与函数名称相同的python文件!