我有以下功能:
def search_stmts(stmts,lower_bound_sura,lower_bound_aya,higher_bound_sura = -1,higher_bound_aya = -1):
ayas_list = []
cnt = 0
for cnt in range(len(stmts[0])):
if stmts[0][cnt] == "root":
ayas_list.append(self.root_lookup(stmts[1][cnt], basicrecord_instance.get_ayas_with_addressing( \
lower_bound_sura,lower_bound_aya,higher_bound_sura, higher_bound_aya)))
elif stmts[0][cnt] == "word":
#print(stmts[1][cnt])
ayas_list.append(self.word_lookup(stmts[1][cnt], basicrecord_instance.get_ayas_with_addressing( \
lower_bound_sura,lower_bound_aya,higher_bound_sura, higher_bound_aya)))
return self.search_ayas(ayas_list)
它将stmts
作为嵌套列表:[['word','root','word'],['hello','how','are']]
和4int
参数。
当我将函数调用为:
search_stmts([['word','word','root'],['hello','how','are']],1,1)
以上通话正常
但是如果我有以下调用,它不会得到任何数据:
list1 = ['root','word','root']
list2 = ['hello','how','are']
search_stmts([list1,list2],1,1)
我怎样才能把我的两张单子作为一张单子传递呢
如果我去掉“basicrecord\u instance”和“self”的functions,就会得到准确的结果
而我正在
相关问题 更多 >
编程相关推荐