for word, sentence in tup:
while True:
x, y, z = random.sample(range(words_count), 3)
if list[x] != list[y] != list[z]:
aya_index += 1
print('breaking after success')
break
else:
print('continuing as there are similar words')
continue
if aya_index > words_count - 1:
print('breaking after finishing')
break
如您所见,上面的代码应该在tup
上循环,并且仅在这三个变量不相等时增加aya_索引,问题是,这是如何在变量之间进行比较,还是有更有效的方法
要比较您可以使用的三个变量:
相关问题 更多 >
编程相关推荐